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:
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>
I have tried to put this on the execute.php page:
code wrote:
<?php
print("$oper");
//I have also tried with:
print("$choice");
?>
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.
I have also tried removing all the names of the <options> ("oper" in my case) so that I could only refer to the combobox through the name "choice"... but still nothing. The $choice variable on execute.php still contains nothing. This problem is really driving me mad...
If anyone can help me, I'd be very grateful!
Thanks