Re: [PHP] HTTP_POST_VARS not and array when used in a function?

2001-04-18 Thread Alexander Skwar
So sprach Joseph Blythe am Wed, Apr 18, 2001 at 10:48:14AM +0930: > Hey, > > Why doesn't HTTP_POST_VARS work inside functions? > > ---somefile.php - forms action --- > > function foo() { >reset($HTTP_POST_VARS); Because this particular HTTP_POST_VARS is not the HTTP_POST_VARS you have

Re: [PHP] HTTP_POST_VARS not and array when used in a function?

2001-04-17 Thread Joseph Blythe
Rasmus Lerdorf wrote: > It is a normal global variable. Like all other global variables you need > to declare the fact that you want the global variable inside a function. > Simply put: global $HTTP_POST_VARS; at the top of your function and it > will work just fine. > > Read the section on var

Re: [PHP] HTTP_POST_VARS not and array when used in a function?

2001-04-17 Thread Rasmus Lerdorf
> I thought the above would work but it returns the following error(s): > > ... value passed to reset is not an array or object ... > ... value passed to each is not an array or object ... > > It seems that HTTP_POST_VARS does not like being called from inside > functions, as the above will work

[PHP] HTTP_POST_VARS not and array when used in a function?

2001-04-17 Thread Joseph Blythe
Hey, Why doesn't HTTP_POST_VARS work inside functions? ---somefile.php - forms action --- function foo() { reset($HTTP_POST_VARS); while( list($key, $val) = each($HTTP_POST_VARS) ) { if ( $key != "Submit" xor $key != "x" xor $key != "y" ) { $inpu