I'm trying to set up a security script that will only allow another script to be run from a specified domain/directory - and any sub directory.
script can NOT run from mydomain.com
script CAN run from mydomain.com/my_directory
script CAN run from mydomain.com/my_directory/sub_directory
So far I have checking for the domain, but can't figure out how to include directoriesAny suggestions would be greatly appreciated!PHP Code:$domain = "www.mydomain.com";
$directory = "/my_dir";
rootPath = "/home/site/public_html";
sitePath = $rootPath.$directory
// let's do some security
$server = $_SERVER["SERVER_NAME"];
// check if the user is authorized
if($server != $domain) {
****
****// not authorized
****echo "ERROR! You are not authorized to run this program on the domain $server";
****exit();
}
else {
$siteURL = "http://".$domain.$directory;
}







Bookmarks