RE: [PHP] Help with addslashes and http post vars..
| From: | Christensen, BruceX R | Date: | Wed, 02 Aug 2000 15:53:32 +0000 |
| Subject: | RE: [PHP] Help with addslashes and http post vars.. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-9723@lists.php.net to get a copy of this message | ||
To fix both the $HTTP_POST_VARS array element and the regular var, do this:
function addSlashesToFormVars() {
global $HTTP_POST_VARS;
while( list( $key, $val ) = each( $HTTP_POST_VARS )) {
$$key = $HTTP_POST_VARS[$key] = addslashes( $val );
}
}
(notice the addition of $$key = )
--Bruce
Bruce Christensen
Intel Corporation
brucex.r.christensen@intel.com
-----Original Message-----
From: Chris Murley [mailto:murley@appindex.net]
Sent: Wednesday, August 02, 2000 7:07 AM
To: Boget, Chris
Cc: php-general@lists.php.net
Subject: RE: [PHP] Help with addslashes and http post vars..
Thanks for the help, while that does work, kinda.
That sets $HTTP_POST_VARS[firstname] witht he add slashes, and it works,
but it doesnt fix $firstname , doe sthat mean i will have to re-asign the
value to each variable?