Gossamer Forum
Home : General : Perl Programming :

HTTP_REFERER problems?

Quote Reply
HTTP_REFERER problems?
 
This function is preventing my script working with parameters given from the URL line.

It works ok when using a POST or GET to send the data, but otherwise it donít recognize the domain
so fails.

So if I use a standard link to the script http://mysite.com/cgi-bin/script.pl?data=1&template=2

it cops out.

Here the code:


############################
#Checks the URL of the Page
############################
if ($ENV{'HTTP_REFERER'} =~ /$domain_name/i){
}
else {
print "Content-Type: text/html\n\n";
print "<HTML>\n<TITLE>Error!</TITLE>\n";
print "<BODY COLOR=\"#FFFFFF\">\n";
print "Could Not Continue!<BR>\n";
print "&nbsp;&nbsp;1.) The URL does not match the one located on the server!<BR>\n";
print "</HTML>";
exit;
}

--------------------------------
Privacy Software

Last edited by:

BLOOD: May 27, 2003, 2:10 PM
Quote Reply
Re: [BLOOD] HTTP_REFERER problems? In reply to
Not sure what you want us to say. Unless you are referred from another page then the referer will be blank.
Quote Reply
Re: [Paul] HTTP_REFERER problems? In reply to
Please excuse, my fault the code here is ok but the one im using had a typo.
Unsure

--------------------------------
Privacy Software