Heading
how i get the selected value of city_id from drop down list and store in a session??
`
<form action="dynamic.php" method="post">
<select name="city" >
<option value="">Select City</option>
<?php
$sql="select * from city ORDER BY city_name";
$result=mysqli_query($con,$sql);
while($row=mysqli_fetch_array($result)){
?>
<option value="<?php echo $row["city_id"];?>"><?php echo $row["city_name"];?></option>
<?php
}
?>
</select>
</form>
<?php
session_start();
if(!empty($_POST['city'])){
$_SESSION['city'] = $_POST['city'];
}
?>