Code: Select all
$path = dirname($_SERVER['PHP_SELF']); // Drop currently requested file name with any $_GET parameters
$redirect_url = str_replace('//', '/', $_SERVER['HTTP_HOST'].'/'.$path.'/login.php');
header("location: http://$redirect_url");
exit;Safe?
This is called inside an index.php which is in the same directory as login.php, so my next question (equally important)
Does the above make sure, that regardless where in a directory structure, the login.php is actually invoked?
What I mean is, assume I had it installed like:
Code: Select all
www.domain.com/test/apps/index.phpCode: Select all
www.domain.com/test/apps/login.phpThanks for any input