I can't seem to be able to send the value of the selected option to another script... I am using the following code to populate the <select> box:
<form name="form1" method="post" action="http://www.mypage.com/script.php?CAT=<?php echo $row['ID']; ?>">
...
<?php
function categories($parent,$parentstring){
$query="SELECT * FROM categories where parent = '$parent'";
$result=mysql_query($query);
if (mysql_num_rows($result)>0){
while ($row=mysql_fetch_assoc($result)){
$tempparentstring=$parentstring;
$tempparentstring=$tempparentstring." > ".$row['Name'];
echo "<option value=\"".$row['ID']."\">";
echo $tempparentstring;
echo "</option>\n";
categories($row['ID'],$tempparentstring);
}
}
}
require ("connect.php");
if (!mysql_select_db($databaseName, $connection))
showerror();
echo "<select name=\"Categories\" size=1><option value=\"none\">Select Category</option>\n";
$query="SELECT * FROM categories where parent IS NULL";
$result=mysql_query($query);
while ($row=mysql_fetch_assoc($result)){
echo "<option value=\"".$row['ID']."\">";
echo $row['Name'];
echo "</option>\n";
categories($row['ID'],$row['Name']);
}
echo "</select>\n";
?>
...
<input type="submit" name="Submit2" value="Next Step">
...
</form>
Now, I have tried a few methods allready...
Including, Sending the value via the URL:
// Select Page
mysite.com/script.php?CAT=<?php echo $row['ID']; ?>
// Validate Page
$id = $_GET["id"];
that didn't work.. maybe because $row['ID'] doesn't have the value when it is requested??
I have no clue what so ever... how i can send it?
Thank-you!