Re: $HTTP_POST_VARS
| From: | Pierre-Alain Joye | Date: | Mon, 04 Sep 2000 10:13:09 +0000 |
| Subject: | Re: $HTTP_POST_VARS | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15090@lists.php.net to get a copy of this message | ||
Hello,
$HTTP_POST_VARS has not a global scope, and you are inside a function. You
can make it global, or get it by getenv, or pass it as arg to
anti_hack(postvars).
_¸,ø¤°
¯°¤ø,¸_¸,ø¤°¯°¤ø,¸_¸,ø¤°¯°¤ø,¸_
(¯·._ (¯·._--={PA Joye}=--_.·¯) _.·¯)
(¯·._ (¯·._--={Fight for your mind}=--_.·¯) _.·¯)
¯°¤ø,¸_¸,ø¤°¯°¤ø,¸_¸,ø¤°¯`°¤ø,¸_¸,ø¤°¯
----- Original Message -----
From: Alex Buell <alex.buell@tahallah.clara.co.uk>
To: <php-general@lists.php.net>
Sent: Monday, September 04, 2000 11:55 AM
Subject: [PHP] $HTTP_POST_VARS
> I'm getting the following error message
>
> Warning: Variable passed to reset() is not an array or object in
> /home/httpd/html/test.php4 on line 38
>
> Warning: Variable passed to key() is not an array or object in
> /home/httpd/html/test.php4 on line 38
>
> Here's the snippet of code that causes the above error messages:
>
> function anti_hack()
> {
> for (reset($HTTP_POST_VARS); $key = key($HTTP_POST_VARS);
> next($HTTP_POST_VARS))
> {
> $this = addslashes($HTTP_POST_VARS[$key]);
> $this = strtr($this, ">", " ");
> $this = strtr($this, "<", " ");
> $this = strtr($this, "|", " ");
>
> $$key = $this;
> }
> }
>
> Any ideas why? I've made sure that track_vars is enabled.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>