Re: [PHP] _SESSION, _POST, and _GET

From: John W. Holmes (holmes072000_at_charter.net)
Date: 11/17/03


Date: Sun, 16 Nov 2003 22:36:44 -0500
To: David T-G <davidtg-php@justpickone.org>

David T-G wrote:

> John, et al --
>
> ...and then John W. Holmes said...
> %
> % David T-G wrote:
> %
> % >I have successfully used extract() to
> % >pull the data out of _SESSION each time; yay.
> %
> % This whole question revolves around the reason you're even extract()ing
> % anything to begin with... Why not just use the $_SESSION, $_POST, etc
> % arrays where you need them. There's no reason to extract().
>
> OK; fair enough. 1) I was just shown it in a recent thread and it seemed
> like a lifesaver :-) 2) I want to get our existing code rewritten to "be
> good" and not lose stuff, like passwords and email addresses, that it's
> supposed to remember -- as quickly as possible.
>
> I know they're famous last words, but I figure I'll do it right later :-)
> [Hey, I'm even thinking of a full top-down rewrite anyway!]

If you're going to extract blindly from $_POST and $_GET, you might as
well just turn register_globals back on; that's what you've basically got.

There's absolutely no reason to extract $_XXX['var'] so you can use $var
instead of just using $_XXX['var'] wherever you need that value...

-- 
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com


Relevant Pages

  • Re: INF install error
    ... Just run the MDAC 2.8 executable you d/l ... There should be no reason to extract anything. ... I check MSDN and Microsoft for resolution, ...
    (microsoft.public.win2000.general)
  • Re: AK dilemma
    ... to make the pot bigger so you can extract more money if you and an ... To avoid having stacks if you play poorly after the flop ... You missed the most important reason for raising AK preflop... ...
    (rec.gambling.poker)
  • per his general echo
    ... have known how to extract ... earth, whatever health and essential comfort, he is not satisfied if he has ... He values human reason so highly that, ... the greatness of man more forcibly than reason convinces them of their ...
    (sci.crypt)
  • Re: Unzipping Files
    ... i unzipped it...but then the files inside are for some reason are zipped ... and it wont allow me to extract the file...im so confused and i have no ... You forgot to tell us what happens when you try to extract the files. ... them to an online web album ...
    (microsoft.public.windows.vista.file_management)
  • Re: trouble creating array of objects
    ... >1 reason he might not want to use vectors is perhaps because he isn't ready ... >Or perhaps he is simply learning about Arrays. ... there is a learning curve to telling newbie's to ... Comeau C/C++ with Dinkumware's Libraries... ...
    (alt.comp.lang.learn.c-cpp)