phpandy123 Posted June 16, 2012 Share Posted June 16, 2012 Hi! I have tried to use stripslashes in a simple test form but my code doesn't remove the backslashes. Why? <?php $subject = trim(stripslashes(htmlspecialchars($_POST['subject']))); $firstname = trim(stripslashes(htmlspecialchars($_POST['firstname']))); $emailTo = "mymail"; mail("$emailTo", "$subject", "$firstname"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/264288-stripslashes-in-form/ Share on other sites More sharing options...
Pikachu2000 Posted June 16, 2012 Share Posted June 16, 2012 If your incoming form data has backslashes in it that you aren't putting there, make sure magic_quotes_gpc is off in you your php.ini file. Quote Link to comment https://forums.phpfreaks.com/topic/264288-stripslashes-in-form/#findComment-1354402 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.