Click to See Complete Forum and Search --> : can i cookie a loser so they dont come back


scottec
02-25-2003, 04:36 PM
right now in my web site if you cancle through a series of questions (on the quiz link) my scripting sends you to a "you suck" page ("watch out it loops")



i want it to send you back to the "You Suck" page when you try to get back into the starting site can it be done and how



my site
(http://www.angelfire.com/theforce/scottec/)

Jona
02-25-2003, 04:41 PM
Well, I'd think it'd be more secure to use a server-side language myself. That's my opinion. I would ban their IP address.

But the code you want is where if they do "this" then you put this cookie on them and send them away; if the just come to the site and have the cookie, send them away because they do have it? That's not too hard, actually. I don't like long cookie codes, so I'll make the code short. That is, once you tell me what the condition is to set the cookie. :)

scottec
02-25-2003, 04:54 PM
whell its kinda weird because i want them to get into the starting sight take the quiz and go to the main site i need a cookie so they can go strate to the main site or strate to my regection site based on wether they passed a quiz you better open this in a new window (http://www.angelfire.com/theforce/scottec/alert.htm)


i fuigured they could get a cookie when they went to the alert site or the main site so when the hit the start site it would send it to one site or another

Jona
02-25-2003, 05:28 PM
Well, your script is reloading the page. You need to make a quiz page. A JavaScript quiz. Now, based on their score, set a cookie. Name it say, "isOk" and if they made 75% of the questions correct, set the value to, "Ok." If their score was less than 75%, set the value of the cookie to, "notOk."

Then, every time the page loads, search through the cookie to find its name (it should find "isOk" from your domain, if not, redirect them to the quiz), and then its value. If its value is "Ok" then redirect them to the site; if not, (if the value is, "notOk") redirect them to somewhere else.

scottec
02-26-2003, 04:22 PM
ive never worked on cookies where do i find the one for this how do i format it

Jona
02-26-2003, 04:59 PM
Let me make a mental note here, and I'll reply to this post later sometime tomorrow probably with an example code of it, ok? Sorry, but I don't have the time to code it right now.

scottec
02-27-2003, 09:01 AM
take your time Jona