You are here: Re: $_POST and Building SQL Strings « PHP Programming Language « IT news, forums, messages
Re: $_POST and Building SQL Strings

Posted by Geoff Berrow on 05/04/07 16:20

Message-ID: <n50sg4-8oj.ln1@ophelia.g5n.co.uk> from Toby A Inkster
contained the following:

>> foreach($_POST as $key=>$val)
>> {
>> $$key = mysql_real_escape_string($val);
>> }
>
>That's no better really. Consider, we'll use $_GET as an example instead
>of POST, as it's easier to illustrate, but the same principle applies:
>
> http://example.com/foo.php?_SESSION[is_administrator]=1
>
>or, say you log IP addresses into your database whenever someone edits
>data...
>
> http://example.com/foo.php?_SERVER[REMOTE_ADDR]=123.45.67.89

Thanks for that Toby. It's always good to have an illustration of what
the potential problem might be.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

 

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

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