I need how to get form POST value on the same page. Below is my script to try and extract the value as well as the form html:
<form action="" id ='list' name= "list" class="form-inline" method="POST">
<div class="select">
<select name="lamp" id ="lamp" onchange="gender(this)" style="background:transparent">
<option id ='gender' hidden="hidden">Gender</option>
<option value="0">Boy's</option>
<option value="1">Girl's</option>
</select>
</div>
</form>
My Php code:
if (isset($_POST)) {
$pg_type =$_POST['lamp'];
echo $pg_type;die;
}
I have echo the my variabe it is showing like:
Notice: Undefined index: lamp in C:\xampp\www\htdocs\rentozy\assets\includes\list-header.php on line 20