note 57203 deleted from function.include by aidan

From: Date: Sat, 15 Apr 2006 16:30:45 +0000
Subject: note 57203 deleted from function.include by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-108153@lists.php.net to get a copy of this message
Note Submitter: Sharter at customsiliconebracelets dot com ---- I put together a scheme to include remote files securely and thought I'd share it. Basically I have a function that contains file names of the remote files I use throught out the site. something like: function remote_files() { global $functions, $log, $etc; $functions = "97I34r5GHKJr5hkjBsjfg.sfd ojhG*(h"; $log = "p9uyjOLIHKYHOGhjk.,nOGihb"; $etc = "jhvb&GVJKe89y984ugfgajzdgf"; return(true); } The strings are actually hash values. When I create the pages on serverX that I know I'll need on serverY I hash them and name them their hash. When I include the file on ServerY I do so using it's variable: include("https://www.serverX.com/includes/remote/{$log}.php"); and I capture it's content using ob_start & ob_get_contents or whatever. I hash the value and compare it to it's file name. If there's no match, I "end;" and print a little error. I'm not working with hundreds of files so it's no too hard to deal with the hash values. Also, the files are pretty well debugged and static at this point.

« previous php.notes (#108153) next »