note 18172 modified in function.stripslashes by erica

From: Date: Mon, 09 Sep 2002 06:55:50 +0000
Subject: note 18172 modified in function.stripslashes by erica
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-36373@lists.php.net to get a copy of this message
try this in conjunction with stripslashes for form to form data tossing with magic quotes on: htmlspecialchars fails because it will then translate the ampersands into &amps; so use this instead: $apos = "'"; $quot = """; if($products){ while (list ($key, $val) = each($products)) { $products[$key] = str_replace("'",$apos,stripslashes($val)); $products[$key] = str_replace('"',$quot,stripslashes($val)); } reset($products); } --was-- try this in conjunction with stripslashes for form to form data tossing with magic quotes on: htmlspecialchars fails because it will then translate the ampersands into &amps; so use this instead: $apos = "'"; $quot = """; if($products){ while (list ($key, $val) = each($products)) { $products[$key] = str_replace("'",$apos,stripslashes($val)); $products[$key] = str_replace('"',$quot,stripslashes($val)); } reset($products); } peace, love and crackiness http://www.dross.com http://www.php.net/manual/en/function.stripslashes.php

« previous php.notes (#36373) next »