I saw some other questions similar to this one in which there were some answers suggested using JS, jQuery but I wanted to ask whether this would be possible for PHP-only or not. I'm honestly okay with any solution, but am that afraid I'd have trouble with implementing other sort of solutions :)
My problem is basically not having the user-chosen select box value after the page is refreshed (i.e. after a PHP form is submitted). I'm already using a free PHP script for this but in the meantime I want to add this "select" option to the form manually (as originally the form doesn't have it). I already sorted out the HTML part, it's something like below:
<select class="form" id="form1" name="form"">
<option value="vals" selected="selected">- All Values -</option>
<option value="val1">Option 1</option>
<option value="val2">Option 2</option>
<option value="val3">Option 3</option>
</select>
Sorry if I sound too noobish, but I really have a little knowledge on PHP and other backends, hope you'll understand. I'll be okay with references, too.
Regards.
You can get the select value from
$selected = $_POST['form']; //It will return the value property of the selected option
Being "form" the name specified in the name property of the .