Hi All,
I wrote this snippet to include in some functions & inclusion files, so that if the script is used in any page but the one intended, the user is moved to another domain. What is wrong in this script?
When I run it, and call the script directly, I get errors in the rest of the file, saying it cannot use functions (Which is normal, since all these are not set, they get set in the masterpage: index).
Shouldn't it evaluate this script, and then not bother about the rest of the page when the index is not found?
$headertest = array_reverse(explode("/", $_SERVER['REQUEST_URI']));
$pos = strpos($headertest[0], "index");
if($pos <> 0)
{
header("Location: somesite"); /* Redirect browser */
exit(); // not needed, but for certainty
}