So I'm trying to get the value of my select element. I've tried testing to see if my php file receives my value, but it doesn't seem to be working.
Here is my php code:
<?php
if (isset($_POST['okButton'])){
$value = $_POST['allCategories1'];
}
?>
And here is my HTML-code:
<form action="index.html" method="post">
<select id="allCategories1">
<option name ="All_categories" value="All_categories">All categories</option>
<option value="No_category">No category</option>
<option value="Shooter_games">Shooter games</option>
<option value="Family_games">Family games</option>
<option value="Action_games">Action games</option>
<option value="Sport _games">Sport games</option>
</select>
<button type="submit" name="okButton" id="okButton">Ok</button>
</form>
I don't know why, but it's not giving me the value of all categories. Anyone know what I did wrong?