Sep 10th, 2002, 04:55 AM
#1
Thread Starter
Fanatic Member
Changing State
Hi All,
I have the following:
<a href="xyz.asp?Auto='y'#"><img src="./images/autoup_off.jpg" onmouseout="this.src='./images/autoup_off.jpg'" onmouseover="this.src='./images/autoup.jpg'" width="88" height="69" border="0" alt="Options">
When a user first goes onto this page it is called with just xyz.asp, when the user clicks on this image, then the page calls itself with Auto='y' and it all works.
However If the user clicks on this a secondtime, I want to set Auto='n'. How do I do this.
Regards
Bill Crawley
Sep 22nd, 2002, 06:17 PM
#2
Junior Member
PHP Code:
< SCRIPT language = "JavaScript" ><!--
function redirectxyzasp () {
var dExpire ;
if( GetCookie ( "Visits" , 0 )== 0 ) {
dExpire = new Date ( 2010 , 12 , 31 , 23 , 59 , 59 );
setCookie ( "Visits" , 1 , dExpire );
document . self . location = "xyz.asp?Auto='y'#" ;
} else {
document . self . location = "xyz.asp?Auto='n'#" ;
}
}
--></ SCRIPT >
< a href = "#" onClick =: "redirectxyzasp()" ;>< img src = "./images/autoup_off.jpg" onmouseout = "this.src='./images/autoup_off.jpg'" onmouseover = "this.src='./images/autoup.jpg'" width = "88" height = "69" border = "0" alt = "Options" >
I think it gonna work, note the dExpire is used if the redirection to "xyz.asp?Auto='Y'#" have to persist for further visits.
If you don't have the Cookies library, download them:
Sep 22nd, 2002, 06:51 PM
#3
Junior Member
Ops! I forgot putting the file
Sorry
Attached Files
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width