The provider's idea was to tell all my users to flush their browser cache and delete cookies before submitting the form. Right.
Since we are in the middle of a major campaign and cannot move the site at this moment, I am looking for a fix. Any ideas? Is it my script, the user's browser, or the host causing the problem?
By the way, I cannot reproduce the error but I have had enough complaints to know it is real.
Again, this is all guessing.
HTH,
-Bill
Just add all possible VALID domains to the list and do it right the first time.
The sections in question should look something like this:
@okaydomains=("http://mydomain.com", "http://www.mydomain.com");
sub valid_page
{
if (@okaydomains == 0)
{return;}
$DOMAIN_OK=0;
$RF=$ENV{'HTTP_REFERER'};
$RF=~tr/A-Z/a-z/;
foreach $ts (@okaydomains) {
if ($RF =~ /$ts/)
{ $DOMAIN_OK=1; }
}
if ( $DOMAIN_OK == 0) {
print "Content-type: text/html\n\n Sorry....Cant run from here!";
exit;
}
}
extremely likely possibility that some malicious or curious person will remotely submit your script countless times per second
There are easier, better ways to do this, such as recording the IP address and not taking any action if a certain threshold is exceeded. A dbm file will take care of this easily.
HTTP_REFERER is supplied by the client, and as such, can't be trusted. It is not a security mechanism.