Ok, so I'm trying to do a simple action where if a user was already viewing our site, we'll display a certain message, otherwise, we want to show a message for first time visitors (or just those without our URL as their referrer)
Else statement only shows as blank regardless how I seem to spin this.
Ideas?
<?php
if (isset($_SERVER['HTTP_REFERER'])) {
$referer = $_SERVER['HTTP_REFERER'];
if (strpos($referer, "http://www.example.com/") === 0) {
echo "Match Okay";
} else {
echo "No Match";
}
}
?>
You should use cookies
SOURCE: http://php.about.com/od/advancedphp/qt/php_cookie.htm