Home > Archive > PERL CGI Beginners > February 2005 > Problem with script requiring valid referrer
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problem with script requiring valid referrer
|
|
| Chris Schults 2005-02-08, 8:55 pm |
| I sent the following email to the Perl Beginners List and was directed here
....
Hey all. On our website we have several forms (send a letter, ask a
question, etc) that some of our visitors seem to have problems with. These
forms require the referring page to be from a Grist Magazine domain.
Here is some of the code:
my $goback = param("goback") || "";
my $url = $goback || referer() || "";
if ($url !~ m{grist}) {
&error("Must be called from a page on Grist Magazine.");
}
We have another script that outputs a printer friendly version of a HTML
page. Some users are experiecing similar problems.
if (!referer) {
print h2 "Sorry, this script cannot be called directly.";
print p "Please try again.";
exit 0;
}
In both cases, our visitors swear that they are linking to these scripts
from valid Grist pages. Any ideas why some people are getting the error
messages? I've asked for browser and O/S info, but many are using the same
setup we are using, which works just fine.
Many thanks in advance!
Chris
P.S. We are recording referrers in our web logs.
| |
| David Dorward 2005-02-09, 3:55 am |
| On Tue, Feb 08, 2005 at 11:43:05AM -0800, Chris Schults wrote:
> In both cases, our visitors swear that they are linking to these scripts
> from valid Grist pages. Any ideas why some people are getting the error
> messages?
The referer header is optional, and when it is used there are a number
of products out there which munge it (e.g. replacing http://foo with
XXX:XXXXX). You can't depend on it.
--
David Dorward http://dorward.me.uk
|
|
|
|
|