2
Try
<script type="text/javascript">
function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ((expiredays==null) ? "" : ";expires="+exdate.toGMTString())+
";path=/";}
function SetLogoSel()
{
x = document.formSelLogo.elements['SelLogo'].selectedIndex;
if (document.formSelLogo.elements['SelLogo'].options[x].value == 'default')
{
setCookie('SelLogo','',-1);
}
else
{
setCookie('SelLogo',document.formSelLogo.elements['SelLogo'].options[x].value ,100);
}
window.location.reload()
}
script>
<form name="formSelLogo">
<select name="SelLogo" onchange="SetLogoSel()">
<option value="default">Logo of the dayoption>
<option value="Monday">Mondayoption>
...
<option value="Sunday">Sundayoption>
select>
form>
Get the cookie value:
if (isset($_COOKIE["SelLogo"]))
{
$today=$_COOKIE["SelLogo"];
}
else
{
$today=date(l);
}
edit: added some missing brackets and page refresh.
edit: use option value iso option text
edit: use root path cookie