0
I want to pass the name of the options by POST to another page. I used this but does not recognize the variable.
echo "<form method=POST action=_search.php>";
echo "<select name=selectoption>";
echo "<option value=nom>nome</option>";
echo "<option value=prenom>ultimo</option>";
echo "</select>";
echo "<input type=submit name=btnsearch value=search >";
echo "</form>";
And on the other page to receive the value,
$var = $_POST['selectoption'];
echo $var;
The number of the selected option or all options? What error are you showing? I did a test with this code of yours and here it worked without errors.
– Antony Alkmim
I added the name in each option, and give me this error Undefined index: selectoption
– akm
already solved, was the name of the options. Thank you
– akm