Referrer problem in formmail

hi guys,

a form on my site started to stop working for some reason, i get the error from the referrer section, when i try to send the form it says " is not authorized to use this form"

function check_referer()

{

    /**

    * check_referer();

    */



    $referer = $_SERVER["HTTP_REFERER"];

    foreach ($this->referers_array as $key=>$value) {

        if ((eregi("^http://$value", $referer)) || 

(eregi(“^https://$value”, $referer))) {

            return true;

        }

    }

    $this->error_message = "<b>$referer</b> is not unauthorized to 

use this
form.<br>
";

    $this-&gt;display_error();

    return false;

}

thanks

What does the script output if you use

$referer = $_SERVER["HTTP_REFERER"];
die($referer);

Also on a side note you don’t need 2 regular expression tests, you can simply use the one by doing.

if (eregi("^http(s)?://$v", $referer)) {
    return true;
}

You do know that some browsers do not send a value in the referrer field and that for those browsers the value you are comparing will always be blank - your code doesn’t seem to allow for those visitors.

Hi,

thanks, i’m php illetirate i’m afraid, this is matt’s formmail script which i used as it was easy to process my form, all i had to do was put in the receivers email.

Would what you are saying cause my problem?

thanks