toughGirl
MIS
- Mar 26, 2001
- 68
Please look at this!!
(
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function setCookie(n,v){
nextYear=new Date();
nextYear.setFullYear(nextYear.getFullYear()+1);
document.cookie=n+"="+v+";expires="+nextYear.toGMTString();
}//end of function
function clearCookie{
var v="nothing";
lastYear=new Date();
lastYear.setFullYear(lastYear.getFullYear()-1);
document.cookie=n+"="+v+";expires="+lastYear.toGMTString();
}//end of function
function getCookie{
theArray=document.cookie.split("; "
for(var i=0;i<theArray.length;i++){
if(theArray.split("="[0]==n){
return theArray.split("="[1];
}//end of if
}//end of for loop
return null;
}//end of function
function checkAll(f){
if(f.save_u.checked){
setCookie("username",f.username.value);
}
else{
clearCookie("username"
}
return true;
}
//-->
</SCRIPT>
</head>
<body>
<FORM ACTION="logIn_action.htm" onSubmit="return checkAll(this)" NAME="logIn_form">
username:
<INPUT TYPE="text" NAME="username"><BR>
password:
<INPUT TYPE="text" NAME="password">
<BR>
save username?<INPUT TYPE="checkbox" NAME="save_u">
<INPUT TYPE="submit">
</FORM>
<SCRIPT LANGUAGE="JavaScript">
<!--
if(getCookie("username"){
document.logIn_form.username.value=getCookie("username"
}
//-->
</SCRIPT>
</body>
</html>
I want to set both the username and password in a cookie. Currently, it is set only to making a username cookie. I also have a cookie_fns.js page.
Can anyone assist me?
tG
(
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function setCookie(n,v){
nextYear=new Date();
nextYear.setFullYear(nextYear.getFullYear()+1);
document.cookie=n+"="+v+";expires="+nextYear.toGMTString();
}//end of function
function clearCookie{
var v="nothing";
lastYear=new Date();
lastYear.setFullYear(lastYear.getFullYear()-1);
document.cookie=n+"="+v+";expires="+lastYear.toGMTString();
}//end of function
function getCookie{
theArray=document.cookie.split("; "
for(var i=0;i<theArray.length;i++){
if(theArray.split("="[0]==n){
return theArray.split("="[1];
}//end of if
}//end of for loop
return null;
}//end of function
function checkAll(f){
if(f.save_u.checked){
setCookie("username",f.username.value);
}
else{
clearCookie("username"
}
return true;
}
//-->
</SCRIPT>
</head>
<body>
<FORM ACTION="logIn_action.htm" onSubmit="return checkAll(this)" NAME="logIn_form">
username:
<INPUT TYPE="text" NAME="username"><BR>
password:
<INPUT TYPE="text" NAME="password">
<BR>
save username?<INPUT TYPE="checkbox" NAME="save_u">
<INPUT TYPE="submit">
</FORM>
<SCRIPT LANGUAGE="JavaScript">
<!--
if(getCookie("username"){
document.logIn_form.username.value=getCookie("username"
}
//-->
</SCRIPT>
</body>
</html>
I want to set both the username and password in a cookie. Currently, it is set only to making a username cookie. I also have a cookie_fns.js page.
Can anyone assist me?
tG