Reply to Re: parameters in URL not readable

Your name:

Reply:


Posted by Colin Fine on 10/29/06 17:53

Chuck Anderson wrote:
> Geoff wrote:
>>> I urge you to fix this, but in the mean while:
>>> extract($_GET);
>>> --
>>> Rik Wasmus
>>>
>>
>> What is the new way to do this?
>> I've read through the link you gave me but it isn't completely clear to
>> me.
>>
>> Geoff
>>
>>
> Quick and dirty:
>
> Use a text editor to include a script at the very beginning of every php
> file:
>
> <?php
> include 'extractor.php';
> ?>
>
> Put this in extractor.php
>
> <?php
> if (is_array($_GET))
> {
> foreach ($_GET as $xxkey => $xxvalue)
> {
> $$xxkey = $xxvalue;
> }
> }
> ?>
>
> (Note: 'xx' is added to the var name to try and keep the var names
> unique, otherwise, if you have passed a GET variable with the same name
> ($key or $value), it would be overwritten by the next iteration of the
> foreach.)
>
> This should get you working, but then I advise you to go back and add
> some real injection prevention functions at the beginning of routines
> that need them.
>

This looks to me like a clumsy way of emulating 'extract($_GET)', as
suggested by Rik. Are you claiming some advantage to doing it this way?

Colin

[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

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