Hi everyone,
I am trying to pass a variable from one PHP file to another one. At some place in my script, a drop-down menu is filled with data collected from my database. From that drop-down menu, a user can select a value. After that he has to click a button. Then the value the user has selected in the drop-down menu has to be transfered to another php-file.
Ahead is the critical piece of code that I use (that doesnt't work). The link to the next page will take part, but the link will only show up like this: http://www(..)darchiv_listkat?rubrice_chosen=
There is no variable at all after the "="!
Ok, here is the code:
<form method=POST action="darchiv_listkat.php?rubric_chosen=$userchoice">
<font face="Verdana, Arial, Helvetica, sans-serif" size=2>Rubrik auswählen:</font>
<select name=userchoice>
<?
while ($myrow = mysql_fetch_row($result)) {echo "<option value=\"$myrow[1]\"> $myrow[1]";}
?>
</select>
<input type="submit" value="Submit your selection">
</form>
As you can see, I want the selected value to be stored in the variable "userchoice". Tha variable is supposed to be transferred to the page "darchiv_listkat.php".
Now, to what do I have to change the <form method=post action="..."> to, to make the form forward my variable?
Thanks for your help!
Greetings, Jens.