Date: 08/05/06 (PHP Community) Keywords: html Below is a rough draft failsafe code I wrote to prevent me or one of the other programmers from putting critical files into //Are we on the local test server? if($_SERVER['SERVER_NAME'] != "localhost" && $_SERVER['SERVER_ADDR'] != "127.0.0.1") { //not local, then are we on the remote? if($_SERVER['SERVER_NAME'] == 'www.myDomain.org' || $_SERVER['SERVER_NAM $_SERVER['SERVER_NAME'] == 'myServer.com') { //Were on the remote, are we where were supposed to be? if(dirname(__FILE__) != "/home/digita23/secureScripts/") { //NO, kill the script //TODO insert mail alarm code //TODO make a proper error msg die("UN } } else { //WTF mate? //TODO insert mail alarm code //TODO make a proper error msg die("UNSECURE SCRIPT - Unable to identify server"); } }
|