I am using a contact form that was intially on just a couple of pages on mysite. Now we need to have it on all pages. The form is set up to only accept from whatever pages you define (which would be tedious and would have to include variables such as mysite.com and www.mysite.com) Is there a way to define excepting submission from all pages in the site and an alias as well? Hope this make sense. don't know code to well. Thanks in advance for help!
$replyemail="mysite@imieducation.com"; //change to your email address $valid_ref1="http://www.mysite.com/index.htm"; //chamge to your domain name $valid_ref2="http://www.mysite.com/index.html"; //chamge to your domain name $valid_ref3="http://www.mysite.com/"; //chamge to your domain name $valid_ref4="http://mysite.com/"; $valid_ref5="http://myaliassite.com/"; $valid_ref6="http://www.myaliassite.com/"; $valid_ref7="http://myaliassite.com/index.html";
// -------- No changes required below here ------------------------------------------------------------- // email variable not set - load $valid_ref1 page if (!isset($_POST['email'])) { echo ""; exit; } $ref_page=$_SERVER["HTTP_REFERER"]; $valid_referrer=0; if($ref_page==$valid_ref1) $valid_referrer=1; elseif($ref_page==$valid_ref2) $valid_referrer=1; elseif($ref_page==$valid_ref3) $valid_referrer=1; elseif($ref_page==$valid_ref4) $valid_referrer=1; elseif($ref_page==$valid_ref5) $valid_referrer=1; elseif($ref_page==$valid_ref6) $valid_referrer=1; elseif($ref_page==$valid_ref7) $valid_referrer=1; if((!$valid_referrer) OR ($_POST["block_spam_bots"]!=12))//if change this change it in the contact form too { echo 'ERROR - not sent. Click here to go back'; echo '
Referrer: '. $ Ref_page;
exit; }