Problem with VARIABLES
| From: | Ian LeBlanc | Date: | Fri, 16 Mar 2001 18:13:06 +0000 |
| Subject: | Problem with VARIABLES | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-44294@lists.php.net to get a copy of this message | ||
I have this page where I am printing some items that are defined by size and color which all the info is pulled from a database.
in the first item loop
PRINT ("<td><input type=\"text\" name=\"$Color$Temp[$f]\" size=\"3\"></td>\n");
translated looks like this.
<td><input type="text" name=\"WhiteS" size="3"></td>
meaning the color white and the size Small.
Now the next loop does what it is suppose to and returns a value of
<td><input type="text" name=\"BlackS" size="3"></td>
These get posted to the next page.
Now for the PROBLEM
without hard coding it how can I get the value of BlackS
meaning I know the color and sizes but how do I put the variable together to print the value of it.
On the 2nd page I would like to echo $Color$Temp[$f] but that does not return the value of the item.
I need $Color$Temp[$f] to turn into the variable not a value. So I can echo the variable.
Someone please help.
(*NOTE* the reason I do not want to hard code it is that I have a list of 102 colors which makes for a really long script.)
PLEASE CC ME ON THE MESSAGE BECAUSE I AM ONLY SUBSCRIBED TO THE DIGEST (I will have to wait some 12 odd hours for the answer)
Regards,
Ian LeBlanc
Web Development
Rask, Inc. - www.rask.com
Phone: (727) 517-2000
Fax: (727) 517-2001