You are here: Re: cleaning and re-using $_POST « PHP Programming Language « IT news, forums, messages
Re: cleaning and re-using $_POST

Posted by Jerry Stuckle on 05/07/06 18:03

Toby Inkster wrote:
> Jerry Stuckle wrote:
>
>
>>First of all, what happens if you need to access the unchanged versions
>>of the $_POST variables? Maybe not now - but you might in the future.
>
>
> Then you add
>
> <?php
> $origpost = $_POST;
> ?>
>
> at the top of your file. :-)
>

Hi, Toby,

Well, as you just said:

"... why create a new array when $_POST already exists (and is conveniently a
superglobal!)?"

:-)

People are used to using $_POST; adding another variable in its place makes
things more confusing. Additionally, if you ever need to merge in other
routines which use $_POST, you'll need to change that code.

The result could end being that some of your code uses $_POST and some doesn't.
This can rapidly become confusing.

And BTW, $origpost won't be a superglobal.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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