Re: register global off

From: Date: Wed, 01 Sep 2004 19:21:07 +0000
Subject: Re: register global off
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-195450@lists.php.net to get a copy of this message
On Wed, 2004-09-01 at 14:05, Afan Pasalic wrote: > I think I am a little bit "confused" about $HTTP_POST_VARS and $_POST. > > php.net manual: Note that $HTTP_POST_VARS and $_POST are different > variables and that PHP handles them as such > http://us4.php.net/reserved.variables > > ????? > > > And the example I wrote still doesn't work: > > <form method=post action=index.php> > name <input type=text name=first_name> > <input type=submit name=SubmitForm value=Submit> > </form> > > After submitting $HTTP_POST_VARS['SubmitForm'] has value 'Submit' and > $POST['SubmitForm'] is empty. > > Why's that? Learn to use print_r(), it will recursively print all the variables in your arrays and such. For example to debug this situation you can do something like: echo '<pre>'; print_r($POST); echo '</pre>'; and you'll see $POST is empty cause you typo'd it, it's $_POST not $POST. Use $_POST, not $HTTP_POST_VARS, the former is the newer array name and I imagine at some point $HTTP_POST_VARS will go away. -- Greg Donald

« previous php.general (#195450) next »