ChrisRChamberlain
Programmer
Hi all
Would like to modify a .php script from phpformmailer, whereby the '.com' or whatever in the following code would become '.net', .org', depending on the current URL.
The values of the variables are error trapped as follows
So if the user has accessed (there is only one actual site), as opposed to the script should still work.
TIA
PDFcommander.com
motrac.co.uk
Would like to modify a .php script from phpformmailer, whereby the '.com' or whatever in the following code would become '.net', .org', depending on the current URL.
Code:
$valid_ref1="[URL unfurl="true"]http://mysite.com/contact.html";[/URL]
$valid_ref2="[URL unfurl="true"]http://www.mysite.com/contact.html";[/URL]
Code:
$ref_page=$_SERVER["HTTP_REFERER"];
$valid_referrer=0;
if($ref_page==$valid_ref1) $valid_referrer=1;
elseif($ref_page==$valid_ref2) $valid_referrer=1;
if(!$valid_referrer)
{
echo "<script language=\"JavaScript\"><!--\n alert(\"ERROR - not sent.\\n\\nCheck your 'valid_ref1' and 'valid_ref2' are correct within contact_process.php.\");\n";
echo "top.location.href = \"contact.html\"; \n// --></script>";
exit;
}
TIA
FAQ184-2483
Chris PDFcommander.com
motrac.co.uk