I am trying to save one of the options in a dropdown menu as a session variable.
<select name="number" id="number">
<option>one</option>
<option>two</option>
<option>three</option>
</select>
<?php
session_start();
$_SESSION['number'] = $_POST['number'];
?>
What it returns in the browser page is:
Notice: Undefined index: number in C:\xampp-portable\htdocs\eva\00ideaselection.php on line 46
- What is the error here?
- What is the best way to save an option from a dropdown menu as session variable?
$_POSTdoesn't have thenumberindex. Recheck that. There isn't enough code here to debug it.isset/emptyin the PHP manual.