PDA

View Full Version : Advanced redirecting


Saj
03-05-2003, 04:20 PM
Hi,

I'm trying to create a script which says pretty much, If the visitor is coming from page.html, then load this page. But, if visitor is coming from anywhere else, then redirect to otherpage.html.

Any ideas?

x_goose_x
03-06-2003, 03:51 AM
if ( document.referrer == "previous site" ) {
location.replace("camefrom.htm");
} else {
location.replace("unknown.htm");
}

Saj
03-06-2003, 01:43 PM
All right, thank you very much.

That works perfectly for me :)