I am trying to save one of the options in a dropdown menu as a session variable.
What it returns in the browser page is:
Notice: Undefined index: number in C:\xampp-portable\htdocs \eva\00ideasele ction.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?
Code:
<select name="number" id="number">
<option>one</option>
<option>two</option>
<option>three</option>
</select>
<?php
session_start();
$_SESSION['number'] = $_POST['number'];
?>
Notice: Undefined index: number in C:\xampp-portable\htdocs \eva\00ideasele ction.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?
Comment