I'm trying to do "a little" site protection. I have this code on a page which I only want accessed from a page on my site. I want the javascript to check that it came from there. If it did load the page, if it didn't, go to an alternate page.
I am coming from the correct page and it shows that.
document.write("you came from " + document.referrer)
if document.referrer.value != " { location.replace("disc_welc.htm"
;
}
It works but send itself into an endless loop, because, of course, I'm telling it to. D'oh!
I want LINK to disc_welc.htm and if it checked out that it came from the right place, display the disc_welc.htm page. If it didn't, go to alternate page.
Does this make sense? Can I do this? I realize the code I have says if not from, then go there, but I don't want to endless loop, but I do want to tell it to go to that page.
Arg... I think I'm in an endless loop.
Thank you.
Puterdude
I am coming from the correct page and it shows that.
document.write("you came from " + document.referrer)
if document.referrer.value != " { location.replace("disc_welc.htm"
}
It works but send itself into an endless loop, because, of course, I'm telling it to. D'oh!
I want LINK to disc_welc.htm and if it checked out that it came from the right place, display the disc_welc.htm page. If it didn't, go to alternate page.
Does this make sense? Can I do this? I realize the code I have says if not from, then go there, but I don't want to endless loop, but I do want to tell it to go to that page.
Arg... I think I'm in an endless loop.
Thank you.
Puterdude