Reply to Re: [PHP] Newbie: Safe function call to a .inc file outside the web folder

Your name:

Reply:


Posted by Chris Shiflett on 08/26/05 05:36

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/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация