You are here: Re: [PHP] Newbie - Request interface for PHP 5 website « PHP « IT news, forums, messages
Re: [PHP] Newbie - Request interface for PHP 5 website

Posted by Jason Barnett on 06/03/05 20:00

Greg Donald wrote:
> On 6/2/05, Info@Best-IT <info@best-it.biz> wrote:
>
>>For PHP 4.x sites I used my index page to capture the HTTP request and use a
>>switch statement to call the content or task based on the $_GET and $_POST
>>arrays. That was very inefficient and the Switch case became totally
>>unmanageable along with the rest of the site.
>>
>>I am re-designing the site using PHP5 and OO design patterns like Composite
>>and Builder as an example. I know these are basic patterns but its a start.
>>Anyway I am not sure how to capture the HTTP request and pass it to the
>>relevant objects. Is there a generic Œway¹ developers process the request
>>to call the classes and generate the needed objects in PHP5?
>
>
> I'd use $_REQUEST if I were expecting to access both $_GET and $_POST
> arrays frequently/equally.
>
> __autoload() is pretty handy, keeps you from writing tons of include statements.
>
>

I agree with Greg. Although I would add that if you are using GET /
POST arguments to determine which pages to include then you minimally
want to filter to be sure they don't try to read sensitive files
(/etc/passwd, "My Documents", and the like). And since I'm paranoid I
might also want to escapeshellarg() the $_REQUEST variable you're using.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

 

Navigation:

[Reply to this 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

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