combobox and mysql
Posted: Tue Sep 27, 2005 11:01 am
Hello all, I'm new to PHP programming.
I've come accross a problem which I can't resolve. I have a php page with a form containing a combobox. In that box, you have 3 choices: modify, delete and add.
The form uses POST method and has as action="execute.php" meaning that when I push on the submit button, the execute.php page is loaded.
Now, the problem is that this execute.php page needs to know which option was selected in the combobox. Is there somehow a way to give a variable to execute.php which tells it what option is selected at the moment the submit button is pressed?
Here is the code of the form:
If anyone can help me, I'd be very grateful!
Thanks
I've come accross a problem which I can't resolve. I have a php page with a form containing a combobox. In that box, you have 3 choices: modify, delete and add.
The form uses POST method and has as action="execute.php" meaning that when I push on the submit button, the execute.php page is loaded.
Now, the problem is that this execute.php page needs to know which option was selected in the combobox. Is there somehow a way to give a variable to execute.php which tells it what option is selected at the moment the submit button is pressed?
Here is the code of the form:
I have tried to put this on the execute.php page:code wrote: <form method=post action="execute.php" name="form1">
<select name="choice">
<option name="oper" value=0> Modify </option>
<option name="oper" value=1> Delete </option>
<option name="oper" value=2> Add </option>
</select>
</form>
But no luck... the value of $oper (or $choice) on execute.php is always a null value while I need to know if it's modify, delete or add that was selected.code wrote: <?php
print("$oper");
//I have also tried with:
print("$choice");
?>
If anyone can help me, I'd be very grateful!
Thanks