Re: Newbie: Safe function call to a .inc file outside the web folder

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux