I have a question for php How can I set a cookie for a variable after pressing an option from a Select tag?
<select name="selection">
<option value="setName">set name</option>
</select>
$select = $_POST['selection'];
if($select == "setName"){
$name = "John Johnson";
}
echo $name;
The selection works great and it sets the value for the variable after making the selection but..... what I want to do , is set a COOKIE that can store that value for the variable so after I reload the page it will print "John Johnson" without having to make the selection again.
Any ideas how to do that?