For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > April 2005 > Help with PHP









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help with PHP
ReClMaples

2005-04-26, 3:56 am


I'm not sure if this is the correct distro to be sending this question to,
if it's not, let me know which one I should send it to.

I am having an issue where a variable in on php file won't go to the next
php file:

Here is the code I am using:

get colors
$get_colors = "select Cat_Name from link_categories order by cat_name";
$get_colors_res = mysql_query($get_colors) or die(mysql_error());

if (mysql_num_rows($get_colors_res) > 0) {
$display_block .= "<P><strong>Categories:</strong>
<select name=\"sel_item_color\">";
while ($colors = mysql_fetch_array($get_colors_res)) {
$item_color = $colors['Cat_Name'];
$display_block .= "<option
value=\"$item_color\">$item_color</option>";
}
$display_block .= "</select>";
}

This gives me a drop down and when I select the item in the drop down that I
want, it should go into the variable "sel_item_color"

then in my included script I have

$cat_name = $_POST['sel_item_color'];

when i try to echo it, nothing comes up. Can anyone help me figure this
out?

Thanks
-Rich


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com