roenving : jeg har et probem med cookies tiltøj
hej exp'er-- det er skal tilføjs det ---
<INPUT TYPE="radio" VALUE="0" NAME="userIcon">Mand <INPUT TYPE="radio" VALUE="1" NAME="userIcon">Kvinde
<script language="javascript" type="text/javascript">
function skrivCookie(name,value,expTime,path){//Tid i dage
switch(skrivCookie.arguments.length){
case 1:
var expTime = 0;
var path = "/";
case 2:
var expTime = 0;
var path = "/";
case 3:
var path = "/";
}
var exp = new Date().getTime()+expTime*24*60*60*1000;
exp = new Date(exp).toGMTString();
var cook = name + " = " + escape(value) + ";expires=" + exp + ";path=" + path;
document.cookie = cook;
}
function hentCookie(name){
if (document.cookie){
var n = document.cookie.indexOf(name+"=");
if (n>-1){
var val = document.cookie.substring(n+name.length+1);
n = val.indexOf(";");
if(n>-1)val=val.substring(0,n);
return unescape(val);
}
}
}
function hentLogin(){
f = document.logind;
cook = hentCookie('login');
if(cook==undefined||cook=="")return;
cook = cook.split('#');
f.chat_navn.value = cook[0];
f.password.value = cook[2];
f.userIcon.checked = true;
f.husklogin.checked = true;
}
</script>
---form ---
<form NAME="logind" method="POST" action="" onsubmit="if(this.husklogin.checked){skrivCookie('login',this.chat_navn.value+'#'+this.userIcon.checked+'#'+this.password.value,1);}else{skrivCookie('login','',0)}">
