note 18172 modified in function.stripslashes by erica
| From: | erica@php.net | 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 &s; 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 &s; 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