You are here: Re: Variable passed in GET or POST array « PHP Programming Language « IT news, forums, messages
Re: Variable passed in GET or POST array

Posted by Kimmo Laine on 01/19/06 07:06

"Chuck Anderson" <websiteaddress@seemy.sig> kirjoitti
viestissδ:U7idnYMyv49cj1LeRVn-tg@comcast.com...
>I have finally started coding with register_globals off (crowd roars -
>yeay!).
>
> This has created a situation that I am not sure how I should handle. I
> have scripts (pages) that can receive an input variable from the POST
> array (initial entry) or it could be in the GET array (go back and re-edit
> a form, for instance.)
>
> In my old sloppy scripting days this was no problem, as I had
> register_globals on and would merely access the the input variable by it's
> local name (whether it was POST or GET made no difference).
>
> What's the best way to handle this situation where I am not sure if the
> input variable is in the GET array or the POST array? My guess is to test
> for the presence of the variable (isset, != '') in either array and then
> copy it to a local variable from that array.
>
> Is that the best, only, or most efficient way to handle that?
>

$_REQUEST <-- it contains both $_GET and $_POST variables :)

--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/>
Kimmo Laine <antaatulla.sikanautaa@gmail.com.NOSPAM.invalid>

 

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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация