[thelist] Question about requiring a specific referring URL

Jen Langley jen at jenlangley.com
Thu Mar 3 12:41:49 CST 2005


This may be totally simple, but I'm not able to figure it out.

I've set up a page for outposted staff to share files. I'm using the
php-written Simple File Manager. It's pretty basic.

I only want folks who log into our Intranet to be able to get to this
page. The intranet is on one server, this page is on another. I don't want
them to bookmark this and if they do, they'll get an error that they must
come FROM our Intranet.

I used this javascript I found online:

<!-- Begin
var requiredfrom = "index.html"; //  required prev. page
if (document.referrer.indexOf(requiredfrom) == -1) {
alert("You must come to this page from " + requiredfrom);
window.location=requiredfrom;
}
//  End -->
</script>

It worked, but then if anyone tried to do anything within the File Manager
(upload a file, etc), they couldn't because they weren't coming *from* the
original referring page anymore.

Am I missing something really easy?
Thanks so much for any help!

Jen.







More information about the thelist mailing list