Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Displaying Data Based On Variable


A Newbie to PHP so please forgive any ignorance of simple methods.

I am trying to develop a site that is driven by a MYSQL database. Dependant on which domain you have been redirected from I need to somehow pickup the domain redirected from and set a global constant to only pull from relative MySQL data e.g FOO = xyz.

This site will obviously have multiple users and I need a way to ensure that user A will be browsing xyz while user B will be browsing abc.

The way I can think of but not entirely sure how to get working in PHP is to assign a Value to the session (FOO) and then on database queries uses WHERE foo_ID = (FOO).




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Data From Table Based On Variable
Im making a website where users sign up to a club each user has a user_id and each club has a club_id. On the first page after logging in I want to be able to include a standard welcome message which will say something like "Welcome to $clubname".

Then once the admin signs in he then has the ability to edit the post and write some information on the club and save it.

However within the website there are lots of different clubs so I need the message that applies to a particular club to only be visible if the user is linked to the club.

My database has 3 tables, 1 for users, 1 for clubs and 1 for welcome.

Displaying 'new' Icon Based On Date?
I'd like to display a little "new" icon next to all products in a directory which are, funnily enough, new! I've got a date (timestamp) for each product which is inserted on adding a new product and updating a product.

I'd like to do a conditional region using the timestamo but I'm not sure what to use - I could do === [current date] but that would only show the icon for that day and I'd like it to be there for about a week or so.

Displaying An Image Based On URL Origination-URL Redirect
I have several domains that use splash pages that point to my main
site:
i.e. http://www.mysite.com/index.php.

How do I replace an image, named "Logo.gif" on the main page
"http://www.mysite.com/index.php" with the image named "logo.gif"
from the URL splashpage, " http://www.mysite.com/SanDiego/"

Both images are named logo.gif because the PHP script references
logo.gif through the script in too many places...It is just easier to
keep the name logo.gif

Problem:
If a user is on the San Diego page and clicks to the main page I want
the user to feel that the site is all about SanDiego.
If a user is on the Los Angeles page and clicks to the main page I want
the user to feel that the site is all about Los Angeles.

Hence the site and database will still be the same..I just want them to
feel the experience is personalized for their city and this will be
determined by changing the logo.gif.

I am using an image named logo.gif that will display SanDiego for the
San Diego page
I am using an image named logo.gif that will display Los Angeles for
the Los Angeles page

I have seen some PHP code that uses php echo $picture I am not sure if
this will work....

Changing A Variable Based On Time Of Day
I want to set a value of a variabel $var based on the time of day
eg
if time is between 10:00pm and 9:00 am
set $var = "foo"

if time is between 9:00 am and 7.00pm
set $var = "bar"

if time is between 7.00pm and 10.00pm
set $var to "foobar"

how do i do this with the timestamp function?

How To Show Table Based On Variable?
I want to display a table on a page based on whether a button is
pressed or not. I'm new at php so I'm sure I'm making a basic
mistake. Here's what I am trying. My thought was that $show_summary
would switch states with each click but it is coming up always true.
So I'm guessing that is the default setting when the page loads. Can
someone please point out where I am going wrong?

if(isset($_POST['summary'])) {
$show_summary = true;
} else {
$show_summary = false;
}

<FORM method="POST" action="testpage.php">
<INPUT type="submit" name="summary" value="Show Summary">
</FORM>

<?php if ($show_summary == true) { ?>
<table border="1" cellpadding="3">
<tr>
<td class="smallText" align="center" width="80%"><?php echo "URL";
?></td>
</tr>
</table>
<?php } ?>

Pagination Based On The No.of Characters In A Variable
I am workign on a news portal which needs paginaiton as usual.but all the code i got depends on the number of records that will come from database.

But i need pagination depends on the number of rows or number characters in a variable.for example if there are more than 100 characters in that it should be display with pagination code.could any one comeup with suggestios on this.

Call Variable Based On Array Position
wondered if it's possible to call a previously set variable(s) by using an array position. For example if I have variables myvar01, myvar02, myvar03 can I somehow call these in a loop, interchanging the numbers? Here is a simplified version of my code:

Number Of Spaces Based On Strlen Of Variable
I can use strlen() to get the length of a string/variable. What I am trying to accomplish is adding a number of spaces after the variable displays on the screen based on how long it is.

For example if my longest strlen() = 6, then for the strings where strlen() = 3, I want to add '&nbsp;&nbsp;&nbsp;' after it, where strlen() = 4 I want to add '&nbsp;&nbsp;' etc.

Getting Data From A Table Based On The Results From Another?
This is the second part of my problems with a top ten list: I'm making a site for guitar effects. I'm trying to make a list of the top ten effects pedals, based on how many effects settings (patches) people have submitted for each pedal. There are two tables, pedals and patches:

I want it to select patches and find out which "pedal_id" is most common, then select that pedal ID from pedals, echo some tuff, then do the query again, except search for the SECOND most popular value, echo it, then the third, echo it, etc etc etc

Retrieve Data Based On The Dates?
I have been searching everywhere on the net on how to retrieve data based on the dates. for eg. today's date. Is it possible to do this? If yes, how can it be done?

Generic Data-based Drop Down Menu
This is becoming incredibly frustrating...

I have a pile of drop downs on one page. They are generated based upon tables in a database. After searching, the user needs to be able to refine their search. They click a form button and go back to the original search page with all the fields retaining the values of the original search. Everything works GREAT except my drop downs! They refuse to remember anything!

Cell Colour Based On Field Data
I have a mysql database and i am using php to display some field data in a table cell on a page. The field data is either 'failed' or 'passed', how can i make the cell colour change depending on the field data result?

Display All Or Selected Data Based On An IF Condition
I am trying to display all and selected data based on an IF condition. It will either execute all the data from the table or selected data based on category. well at least it is supposed too. I can take out the select * query and it will work but I need to use both.

And I want the page to load all the data from the table on reload or load and when someone selects the list box and hits submit it will only display the selected ones on a web page.  Its probably something simple but I cant see why I dont get any results to display. Code:

PHP And Time Zone: Display Data Based On Localtime
How to do this in a good way:

Find local time of the visitor [the visitor's local machine] and pull out data from the database based on his machines local time (can be wrong or right no problem with that).

What do you suggest?

Redundant Data Display Based On Multi-value Fields
I have a website where I want to send an email out to a bunch of users of all the new content posted that day. My content is tagged in different genres or groups. A piece of content can have multiple tags. So an example would be that my content is called "Video Program A" and it has been tagged in the vocabulary "Genre" as "Horror" and also as "Narrative". So in my email, if a piece of content has been tagged more than once, all the other fields get printed out multiple times, too. How can I make it so that even if the there are multiple termname and vocabname data, the rest of the data (title, description) only gets printed out once? Code:

Repeat Form Field Based On $_POST Data
i have a script that sets up a second page with multiple select boxes. the first script has a hidden field for the ID number, and a text input field for quantity. the second part of the script has a foreach loop that gets the info that goes with the ID number and then creates the select box next to it. for the most part it's all working correctly, but i don't know how to get the submitted "quantity" to repeat that ID number (and everything else). here is the initial form: Code:

Variable Not Displaying...
Basically on my login page i've created a feature to ban an IP per 30 minutes
due to brute forcing, however they have 3 attempts to login before they get
banned...

I have made a function which will display the number of records, for this 1 IP.
basically it will only store 1 record which is not set a ban or expired.

Displaying Data
Probably a really stupid question to ask, but if i have a number in mysql lets say 180000 and it represents a price is there a way to change that to 180,000 without saving it in the database like that?

Nsert Character Into Variable For Displaying
Is there a way of splitting a variable after a certain length, adding a character, then continue writing the rest of the variable?
Basically I have a set of number that I'm getting from a database, but I want to insert a space in the middle..
for example:
01234567 //would become
0123 4567
I'm wanting to do this for displaying the numbers as the numbers are stored without the spaces. This is done for a reason, not to make it a pain for myself.

Displaying Wrong Data?
I have a PHP script that inserts data into a database: PHP Code:

Displaying Data In Php - Like HTML?
How do I display data from MYSQL in PHP in an attractive and structured table(HTML) format? For example: I want my database to display all the reviews of a particular movie(like metacritic.com) like this: Code:

Displaying Data From Array
I have a data stored in an array. Want to display it in Internet Explorer... However,could not display it.

Inputing And Displaying Data
i have a website that will list certain shops in my area. i want these shops to be displayed in a table with 4 columns on my website, the first being the name of the shop and when you click on the shop it links you to there website. the rest of the columns will be different images depending on what service they provide.

i thought i could create a form that allows me to input the name of the shop etc, but each time i submit the form it adds the information to my database and creates a new row each time i submit a new shop on the table on my website page.

im very new to php and sql so it would be helpful if you could link me to a tutorial that sort of tells you how to do this or add me on msn.

plus i was just wondering if it is worth buying a book about php and mysql or should i stick to online tutorials. if it is, please recommend me some.

Grabbing Data From A Table And Displaying It
I'm grabbing data from a table and displaying it but I want to to spand out into multiple pages...I got it all setup but when I click on the next link nothing happens... I got it setup at "3" right now just for testing..I have 5 entries in the database.. anyways could someone help me out? here is the code:

<?php

// Get connection info
include "../connect.php";
// End connection info
if(!$rowstart) $rowstart=0;
// Start database select
$result = mysql_query(
"SELECT * FROM links WHERE notactive='$notactive' order by date desc limit $rowstart,3"); //Select Database
$result2 = mysql_query("select * from links");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>"); exit(); }
// Display the text of each host
while ( $row = mysql_fetch_array($result) ) {
if ($notactive = 1) {
echo ("<table width=500 height=57 border=0 cellpadding=0 cellspacing=0>");
echo ("<tr>");
echo ("<td align=left valign=top><strong>" . $row["name"] . "</strong></td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top>" . $row["desc"] . "</td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top><a href=" . $row["url"] . ">". $row["url"] ."</a></td>"); }
echo ("</tr>");
echo ("<br><br>");
echo ("</table>");
}
if ($rowstart>$numrows)
{
echo "<A HREF=$php_self?rowstart=rowstart-3>";
echo "< Previous Page</A>";
}
echo "|";
$numrows=mysql_num_rows($result2);
if($rowstart+3<$numrows)
{
echo "<A HREF='$php_self?$rowstart=rowstart+3'>Next Page></A>";
}
?>

Grabbing Data From A Table And Displaying It
I'm grabbing data from a table and displaying it but I want to to spand out into multiple pages...I got it all setup but when I click on the next link nothing happens... I got it setup at "3" right now just for testing..I have 5 entries in the database.. anyways could someone help me out? here is the code:

<?php

// Get connection info
include "../connect.php";
// End connection info
if(!$rowstart) $rowstart=0;
// Start database select
$result = mysql_query(
"SELECT * FROM links WHERE notactive='$notactive' order by date desc limit $rowstart,3"); //Select Database
$result2 = mysql_query("select * from links");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>"); exit(); }
// Display the text of each host
while ( $row = mysql_fetch_array($result) ) {
if ($notactive = 1) {
echo ("<table width=500 height=57 border=0 cellpadding=0 cellspacing=0>");
echo ("<tr>");
echo ("<td align=left valign=top><strong>" . $row["name"] . "</strong></td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top>" . $row["desc"] . "</td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top><a href=" . $row["url"] . ">". $row["url"] ."</a></td>"); }
echo ("</tr>");
echo ("<br><br>");
echo ("</table>");
}
if ($rowstart>$numrows)
{
echo "<A HREF=$php_self?rowstart=rowstart-3>";
echo "< Previous Page</A>";
}
echo "|";
$numrows=mysql_num_rows($result2);
if($rowstart+3<$numrows)
{
echo "<A HREF='$php_self?$rowstart=rowstart+3'>Next Page></A>";
}
?>

Grabbing Data From A Table And Displaying It
I'm grabbing data from a table and displaying it but I want to to spand out into multiple pages...I got it all setup but when I click on the next link nothing happens... I got it setup at "3" right now just for testing..I have 5 entries in the database.. anyways could someone help me out? here is the code:

<?php

// Get connection info
include "../connect.php";
// End connection info
if(!$rowstart) $rowstart=0;
// Start database select
$result = mysql_query(
"SELECT * FROM links WHERE notactive='$notactive' order by date desc limit $rowstart,3"); //Select Database
$result2 = mysql_query("select * from links");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>"); exit(); }
// Display the text of each host
while ( $row = mysql_fetch_array($result) ) {
if ($notactive = 1) {
echo ("<table width=500 height=57 border=0 cellpadding=0 cellspacing=0>");
echo ("<tr>");
echo ("<td align=left valign=top><strong>" . $row["name"] . "</strong></td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top>" . $row["desc"] . "</td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top><a href=" . $row["url"] . ">". $row["url"] ."</a></td>"); }
echo ("</tr>");
echo ("<br><br>");
echo ("</table>");
}
if ($rowstart>$numrows)
{
echo "<A HREF=$php_self?rowstart=rowstart-3>";
echo "< Previous Page</A>";
}
echo "|";
$numrows=mysql_num_rows($result2);
if($rowstart+3<$numrows)
{
echo "<A HREF='$php_self?$rowstart=rowstart+3'>Next Page></A>";
}
?>

Grabbing Data From A Table And Displaying It
I'm grabbing data from a table and displaying it but I want to to spand out into multiple pages...I got it all setup but when I click on the next link nothing happens... I got it setup at "3" right now just for testing..I have 5 entries in the database.. anyways could someone help me out? here is the code:

<?php

// Get connection info
include "../connect.php";
// End connection info
if(!$rowstart) $rowstart=0;
// Start database select
$result = mysql_query(
"SELECT * FROM links WHERE notactive='$notactive' order by date desc limit $rowstart,3"); //Select Database
$result2 = mysql_query("select * from links");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>"); exit(); }
// Display the text of each host
while ( $row = mysql_fetch_array($result) ) {
if ($notactive = 1) {
echo ("<table width=500 height=57 border=0 cellpadding=0 cellspacing=0>");
echo ("<tr>");
echo ("<td align=left valign=top><strong>" . $row["name"] . "</strong></td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top>" . $row["desc"] . "</td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top><a href=" . $row["url"] . ">". $row["url"] ."</a></td>"); }
echo ("</tr>");
echo ("<br><br>");
echo ("</table>");
}
if ($rowstart>$numrows)
{
echo "<A HREF=$php_self?rowstart=rowstart-3>";
echo "< Previous Page</A>";
}
echo "|";
$numrows=mysql_num_rows($result2);
if($rowstart+3<$numrows)
{
echo "<A HREF='$php_self?$rowstart=rowstart+3'>Next Page></A>";
}
?>

PHP MySQL Query Not Displaying Data
I am having some problems with a database query that I am trying to do.
I am trying to develop a way to search a database for an entry and
then edit the existing values. Upon submit, the new values are updated
in all corresponding tables (the function of the pages in question).
However, on the page that does the DB update, I also want to do some
checks on the data before performing the update.

Now, the problem that I am running into is that when I don't update the
primary key field (keyid) the page is running into the section where it
displays a message that the keyid already exists. This only happens
when the keyid on the previous page is not changed.

Upon troubleshooting the problem I found that the very first SELECT
statement does not seem to be returning any rows despite the fact that
the statement, when run on the SQL server, returns exactly one row. If
any could provide some assistance with this matter, I would be most
appreciative.

Code:
<?php
session_start();
header("Cache-control: private"); //IE 6 Fix

//continue if authenticated
if ($_SESSION['auth'] == 1)
{

//get variables from post
$keyid = $_POST['keyid'];
$username = $_POST['username'];
$corpid = $_POST['corpid'];
$usergroupname = $_POST['usergroupname'];
$oldkeyid = $_POST['oldkeyid'];
$oldcorpid = $_POST['oldcorpid'];
echo("Keyid: $keyid");

// Connect to MySQL
mysql_connect ("address.com", "user", "pass")
or die ('I cannot connect to the database because: ' .
mysql_error());
//select database on server
mysql_select_db ("seniorproject");

//SQL Statement
$sql = "SELECT keyid, corpid FROM users
WHERE keyid='".$keyid"'";

// Execute the query and put results in $result

$result = mysql_query( $sql )
or die ( 'Unable to execute query.' );
echo mysql_result($result,0);

// Count number of matches and print to screen
$numrows = mysql_numrows( $result );
if ($numrows == 1)
{echo(" SQL Query: $sql");
$result_ar = mysql_fetch_row($result);
$result_ar = mysql_fetch_row($result);
$dbkeyid = $result_ar['keyid'];
$dbcorpid = $result_ar['corpid'];
echo("<br> CorpID: $corpid <br>");
echo(" DBCorpid: $dbcorpid <br>");
echo(" DBKeyID: $dbkeyid <br>");
if($dbcorpid == $oldcorpid)
{
//If this condition is true, then KEYID has not changed. Execute
code

// Formulate the query

$sql = "UPDATE users
SET corpid = '".$corpid."', username = '".$username."',
usergroup = '".$usergroupname."', keyid = '".$keyid."'
WHERE keyid = '".$oldkeyid."'";........

Displaying Data In A Editing Form
I have a form that has three checkboxes. A,B&C. Data from A & C has been entered into the database by serializing it.I now want to create a edit form where the user can view his choices ticked.

<form action="postoDb.php">
A<input type="checkbox" name="Choice[]" value="A">
B<input type="checkbox" name="Choice[]" value="B">
C<input type="checkbox" name="Choice[]" value="C">
</form>

//postodb.php
$bn = serialize($Choice);
sql ="insert into table (choice) values('$bn')";

Displaying Rows Of Data As Columns?
Does anyone know of an efficient way to retreive data from a mysql db
and display the record rows as collumns?

I have been doing this:
<display headers>
<while ($row = mysql_fetch_array($result)) { >
<display row 1 of result>
<display row 2... } >
<end table>

but I want to do this instead:
<col 1 header > <row 1 col 1> <row 2 col1> <row3 col1>
<col 2 header> <row 1 col 2> <row 2 col2> <row3 col2>
<col 3 header> <row 1 col 3> <row 2 col3> <row3 col3>

Question About Displaying MySQLl Data
Could someone point in the correct direction with regards to displaying my
data in "nicer" format. I have figured out ( with the tutorials on the web,
and the O'Reilly PHP & MySQL book) how to store, retrieve, manipulate, and
display my data using PHP. But when I do display, it is the block format.
I can't seem to find a tutorial that gets into a "prettier" type of display.

Is this a HTML issue?

I am a newbie to this stuff

Displaying Data In Html Table.
I wondered if anyone could offer some guidance, I trying to write a
php script to connect to a database, and display the records in a
table.

I found the code here in a php4 text, and when I run this directly
through the php intrupeter, the line Successfully connected is display
and 4 as the number of rows.

The database table we connect to, has three field username, firstname,
surname.

When I tried a while loop, to display the data in a table. No values
were displayed.

Could anyone possibly demonstrate how to display the username,
firstname, surname values in a basic table?

<?php
function db_connect(){
global $MYSQL_ERRNO, $MYSQL_ERROR;

$link_id = mysql_connect("localhost","user04", "password04");

if(!$link_id){
$MYSQL_ERROR = "Connection failed";
return 0;
}
else if(empty($dbname) && !mysql_select_db("database04")){
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link_id;
}

!$link_id = db_connect();
if(!$link_id) die(error_message('Error connecting'));

$result = mysql_query("SELECT * FROM users");
if(!$result) error_message('Error in selection');
else echo "Successfully connected. ";

$query_data = mysql_fetch_row($result);
$total_records = $query_data[0];

if(!$total_records) error_message('No records');
else echo "$total_records.";
?>

Displaying Data From A Flat File?
ive got a flatfile database sorted out, all i need now is how to store individual flat files per user and how to paginate that data. Just to make sure i'm doing everything right, i'll post the code below Code:

Drop-down Displaying MySQL Data
I've got this dropdown trying to call the data in...basically, I only want it to show if it is an upcoming event. Past events are hidden away in the archives.

I can get it to work if I remove the if ($row['date'] etc, but not with it in. Can anyone spot any errors with my code? Code:

Displaying All Data From Fetch Array
I'm having a problem displaying more then 1 result from a mysql_fetch_array statement in my php application.....

Displaying Line Breaks From MySQL Data
when i retrieve data from a MySQL database which i have put line breaks in they do not show in html, i understand that this is because HTML ignores spaces unless they are formatted as &nbsp; i know i could use the <pre> tag to show it as it was given, which removes all styling from the text, i need to convert the breaks in MySQL into <br> or <br><br> (to start a new paragraph)

Combining Data From Two Fields, Displaying With Another Table
What I am trying to do is pull data from two tables and display it on one page. The code below doesn't display any errors, but all it prints is the results from the first query. Ideas? Thanks.

(I also need to somehow put a variable in for the warranty table data so it is tied to the product_status table data. You can see there is a WHERE in the first query of pid, but no WHERE in the second query. That is a seperate question, though. It would make this way too long, so I will post it separately). PHP Code:

Hide Characters When Displaying Recordset Data ?
i have a mysql and php website, some of the products have an _ underscore (epson_dx500 eg) . i display these items listed vert down the page, i want the data in the table to stay the same but when displayed on the page i want to hide the underscore.

Displaying Binary Data To Browser And Set Mime Type
I am looking for a link or help on how to set the
mime type in my php script as well as send binary data to the browser
window instead of having it ask me to save the file.

Displaying Data From Mysql Database In A Drop Down List On Form.
I'm trying to do is display data from two different mysql tables from the same database in a drop down list on a html form. I have a fixtures table with the player1(userid), player2(userid), gameid, game, score1 and 2, what I want is to use the userid to get the players first name and surname from the members table (as it is a unique id), I need to do this bit before displaying it in the drop down. I think i need 2 querys to do this but when I have tried it it just echo's a blank value or the userid not the forname and surname that I want. I'm using the fetch_array function but just can't see where I'm going wrong, Code:

Getting Array Data Into A Variable
I've spent most of today trying to solve this problem, but sadly no
luck.
I have an shopping basket based on an array which stores the name,
product id, quantity and price for products, i want to take the
Information in the array and output the Quantity and Product ID
information into variables so that i can pass them into a Select
Statement and submit the order to the database.

The Current Code to Show the cart is listed below: -

function show_cart() {
if (isset($_SESSION["item_count"]) && $_SESSION["item_count"] > 0) {
echo "<table class="basket"border="0">";
echo
"<tr><td>Item</td><td>Price</td><td>Amount</td><td>Subtotal</td></td></tr>";

$total = 0;
for($i=0; $i<$_SESSION["item_count"]; $i++) {

echo "<td><a
href=insertselfpagehere.php?deleteitem=1&ProdID=".$_SESSION["items"][$i][0].">";

$item=$_SESSION["items"][$i][0];
echo $_SESSION["items"][$i][1]."</a></td>";
echo "<td>".$_SESSION["items"][$i][2]."</td>";
echo "<td>*".$_SESSION["items"][$i][3]."</td>";
$subtotal = $_SESSION["items"][$i][2] * $_SESSION["items"][$i][3];
echo "<td align="right">$subtotal</td>";
echo "</tr>";
$total += $subtotal;
}
echo "<tr><td><b>total</b></td><td align="right"
colspan="3">$total</td></tr></table>";
}

else {
echo "No items";
}
}

Parsing XML Data To Variable
I've been struggling with this for the past 2 days and have tried various
solutions.

I need to parse the following XML file and extract the data into variables

<?xml version="1.0" encoding="UTF-8" ?>
<shareprice>
<exchange>LSE</exchange>
<symbol>BWD</symbol>
<price>440.00</price>
<date>19 Aug</date>
<time>11:20am</time>
<change>+1.00</change>
<percent>+0.23</percent>
<volume>1250</volume>
</shareprice>

All I need is the data to be extracted into the following variables

$exchange
$symbol
$price
$date
$time
$change
$percent
$volume

Set Variable Data Types
I know that PHP automatically sets the data types so you don't worry about it normally.  In my case, when using trigonometric functions -- it automatically sets the data type for the variables as "radians".  I know about rad2deg and deg2rad functions but that won't work.  My users input a degree and so I want the type to be immediatly set as "degrees" NOT "radians".

How do it set the variable type to "degrees" at the exact time the user inputs the value in the form?

Loading All The Data Of A Page Into A Variable.
I was wondering how you would go about emulating

header('Content-Type: application/csv');
header('Content-Disposition: attachment; filename=' . 'test' . '.csv');

but instead of getting a file...I would like to load all the data into
a variable.
Is this possible?

Taking Off Letters From The Data In The Variable
I want to bring in information into a textbox. It will contain a URL to an image. But i only want the image name to be shown not the whole url. Example: image.gif - Will be shown in the textbox:

http://www.yourdomain.com/images/image.gif - This is not want i want. I want the first X characters to be removed. Which would be this: http://www.yourdomain.com/images/

how do i go about doing that. <input class="textfield" type="text" name="image" value="$image"> $image is my variable that hold the image source.

Variable Data In Dynamic Table.
What I'm trying to do is list the values of an array into different table rows while alternating the color of the table rows. Simple enough right? It makes the table fine. Creates the proper ammount of rows. It even alternates color (yay!). The only thing that it doesn't do is list the values in the array. PHP Code:

Session Variable Loses Its Data
I'm working on a login page, using sessions. In login.php, the session variable $valid_user is set if the username/password is correct, and the username is stored into $valid_user.

When I proceed to the next page (overview.php), the content which is to be shown to logged-in users only is shown correctly. If the user is not logged in, the appropriate error message appears (and no user-only content is shown).

The problem I have in overview.php is that $valid_user (the session variable) has nothing stored in it. I have started the session in overview.php and I do not get any session warnings. $valid_user is set, it's empty though (if it wouldn't be set, the logic of this page would not work, but it does). I also didn't unset or clear $valid_user.

Naming A Variable By The Data In Mysql
I am trying to figure the best way to automate creation of radio buttions in an edit user page. If that can be accomplished, then it would need to also go in the sql statement below, the variable declaration, and the hidden input. Code:

EyeOS : Opensource Web Based Operating System Based On "php"
EyeOS is a Opensource web based operating system based on "php".

try demo here

http://eyeos.info/eyeOS/


Copyright © 2005-08 www.BigResource.com, All rights reserved