PDA

View Full Version : URL Checker


DJDiaper
08-15-2003, 04:47 AM
I have been trying to use an URL Checker. This means that people who enter a page, other than with a direct link from a certain page, will not be able to enter...

It seems to work for some people, but other can get in. Maybe it is the browser type, or a proxyserver? I don't know. Could anyone tell me what I am doing wrong here?
Or can some of you provide a script that could take care of the entire problem?

Thanx in advance,
DJDiaper

This is the script I use:
<body
onload="if(document.referrer.indexOf('http://www.whatever.com/whatever.html')
== -1) { self.location.replace('http://www.whatever.com/404.html'); }">

Dennis
08-15-2003, 06:45 AM
nothing wrong... but i would do so (it is similar)


<script>
function dennis(){
if(document.referrer.indexOf('www.site.it')
>-1) {
document.location.href='www.rightsite.it');
}
else
{
document.location.href='www.wrongsite.it'
}

<body onload="dennis()">

DJDiaper
08-15-2003, 06:48 AM
Thanx a lot, but I am now looking to also fool people who have java disabled... Any ideas?

Dennis
08-15-2003, 06:54 AM
<script>
if(navitagor.javaEnabled()){
alert('Java enabled')
}
else{
alert('java disabled')
}
</script>

DJDiaper
08-15-2003, 07:16 AM
I tried it, but it does not seem to work... Strange really.

What did I do wrong here?

Dennis
08-15-2003, 01:13 PM
Mea culpa.

Try so:


<script>
if(navigator.javaEnabled()){
alert('Java enabled')
}
else{
alert('java disabled')
}
</script>