in reply to Getting the url of referring page
It looks a bit like:
Suggested reading: perldoc CGI#!/usr/bin/perl -w use strict; use CGI; my $C = CGI->new; if($C->referer eq 'some URL'){ process_page(); } else{ bounce_page(); }
update: I should've mentioned what dws mentions below, that referer is not always present or accurate (although one can make a case for why browsers should *not* strip/alter this header). Your other solution is to generate a session ID or form key on the originating page (as a hidden field) that must be submitted along with the form or used as part of the URL. But that will only work if you are using forms, not just plain links. You might be able to get it to work with some JavaScript trickery, but to my way of thinking that's worse than simply denying access to people who munge referer headers.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Getting the url of referring page
by Theseus (Pilgrim) on Jul 20, 2002 at 00:39 UTC |