// Check the existence of "havecookie" cookie. If cookie exists, that // means user had already accessed te site before. In this case, just // let the user continue. If it doesn't exist, then re-direct the user // to the page "ttt.php" where it checks for cookie functionality. if ( !isset($_COOKIE['havecookie']) ) { $redirect_url = "http://" . $_SERVER['HTTP_HOST'] . dirname ($_SERVER['PHP_SELF']); if ( (substr($redirect_url, -1) == '/') or (substr($redirect_url, -1) == '\\') ) { $redirect_url = substr($redirect_url, 0, -1); } $redirect_url .= "/ttt.php"; header("Location:" . $redirect_url); exit(); } ?>