Forum Moderators: coopster
if ($_SERVER['HTTP_REFERER']="http://www.example.com/example.php") {
send the form }
else {
take them back to www.example.com
}
I have 3 pages.
1) The form page
2) The page that sends the email
3) Thank you page
Where does this code need to go in order to make this work?
$_SERVER['HTTP_REFERER'] is set by the browser, not by PHP. Therefore it can be faked. If you find you're having problems in the future, you're better off setting a few $_SESSION variables using $_SERVER['SCRIPT_FILENAME'] to track which script is being executed, and the last one to be executed. I think that would be more accurate.