I want to define a variable ($_SESSION['name']
) when a option is selected (without posting) When select a option, it should define the the variable without posting or refreshing the page. For example something like this, maybe with jQuery or something. Can someone help me out?
<select name="location">
<option <?php $_SESSION['name'] = "US";?>>US</option>
<option <?php $_SESSION['name'] = "GB";?>>GB</option>
<option <?php $_SESSION['name'] = "DE";?>>DE</option>
</select>