Cannot get this code working. I’m try to set cookie but only get Warning: Cannot modify header information - headers already sent by .... on line 8
<?php
if(isset($_GET['set']))
{
$l = $_GET['set'];
switch($l)
{
case $l:
setcookie("lang", "$l", time()+600, '/');
break;
}
}
?>
<a href="?set=1">1</a> | <a href="?set=2">2</a>