Re: Newbie: Safe function call to a .inc file outside the web folder
| From: | Chris Shiflett | Date: | Fri, 26 Aug 2005 02:36:45 +0000 |
| Subject: | Re: Newbie: Safe function call to a .inc file outside the web folder | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-221389@lists.php.net to get a copy of this message | ||
Graham Anderson wrote:
Is their some other reasonably safe way to call to the script outside the web folder?Assuming you don't have too many hosts, a better way to write this:
$brainPath = "/home/".$server."/includes/fonovisa.inc";is to use a switch statement to make sure $server is valid: switch($server) {
case 'yourserver':
case 'another':
case 'yetanother':
$brain_path = "/home/$server/includes/fonovisa.inc";
break;
}
Something like that. :-)
Chris
--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/