HTTP_POST_VARS empty!

From: Date: Wed, 12 Mar 2003 18:12:41 +0000
Subject: HTTP_POST_VARS empty!
Groups: php.general 
Request: Send a blank email to php-general+get-139350@lists.php.net to get a copy of this message
Hello, I don't understand this code empty my HTTP_POST_VARS variable: if ((get_magic_quotes_gpc() == 1)) { switch ($REQUEST_METHOD) { case "POST":
    while (list ($key, $val) = each ($HTTP_POST_VARS)) {
      $$key = stripslashes($val);
    }
    break;
case "GET":
    while (list ($key, $val) = each ($HTTP_GET_VARS)) {
      $$key = stripslashes($val);
    }
    break;
} } This script is usefull to simulate get_magic_quotes_gpc to 0 but if I do it it empty my HTTP_POST_VARS and this code does not work:
    while(list ($key, $val) = each($HTTP_POST_VARS)) {
      echo "$key => $val<br>";
    }
    echo "Here we are...!!!..." ;
It displays, "Here we are...!!!..." but nothing at all for $key and for $val How should I do to simulate get_magic_quotes_gpc to 0 without emptying HTTP_POST_VARS ? Thanks, Vincent. PS: If I delete the code ...(get_magic_quotes_gpc() == 1)...it works...

« previous php.general (#139350) next »