How to unquote a string in PHP -
if quote variable prevent sql injection such:
$safe_email = $db->quote($_post['email']);
if $_post['email']
= abc@example.com
and following:
echo $safe_email;
i get:
"abc@example.com"
the php documentation says stripslashes
function "un-quotes quoted string".
however when use on quoted string such:
echo stripslashes($safe_email);
i still string printed out in quotes
what seems problem here? it's still printing out in quotes
what's wrong this?
filter_var($_post['email'], filter_sanitize_email)
your question worries me. please read on pdo, bind parameters, , rest easier @ night. road seem traveling down 1 of security risks, , not end well.
side note: sanitize both client side , server side, , bind parameters appropriately. maybe i'm paranoid, ounce of prevention worth pound of cures imo.
well since don't seem interested in right way
$email = str_replace('"','',$email);
Comments
Post a Comment