Newbie: Safe function call to a .inc file outside the web folder
| From: | Graham Anderson | Date: | Thu, 25 Aug 2005 23:43:19 +0000 |
| Subject: | Newbie: Safe function call to a .inc file outside the web folder | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-221385@lists.php.net to get a copy of this message | ||
I am relatively new to security....
Is the below reasonable safe ?
I have all of my main functions outside the web folder
I am including this function with every php script that accesses fonovisa.inc
function getBrain()
{
$temp = explode('.', $_SERVER['SERVER_NAME']); // returns 'www.myserver.com'
$size = count($temp);
$server = $temp[$size -2]; // returns 'myserver'
$brainPath = "/home/".$server."/includes/fonovisa.inc";
require_once($brainPath);
}
is this ok ?
Any help is appreciated :)
g