shadiadiph Posted March 13, 2009 Share Posted March 13, 2009 I have a form that passes to another to display so i am using stripslashes to remove the \ which occur after a 's then it passes to another submit page i have tried using stripslashes on this page but it keeps returning any instance of 's \'s how can i fix this i am confused Quote Link to comment https://forums.phpfreaks.com/topic/149196-solved-slashes-problem/ Share on other sites More sharing options...
trq Posted March 13, 2009 Share Posted March 13, 2009 stripslashes should work, we need to see some relevent code. Quote Link to comment https://forums.phpfreaks.com/topic/149196-solved-slashes-problem/#findComment-783477 Share on other sites More sharing options...
The Little Guy Posted March 13, 2009 Share Posted March 13, 2009 try using it twice... stripslashes(stripslashes($string)); Quote Link to comment https://forums.phpfreaks.com/topic/149196-solved-slashes-problem/#findComment-783481 Share on other sites More sharing options...
Philip Posted March 13, 2009 Share Posted March 13, 2009 Also, are magic quotes on and you are using addslashes( ) That would put I'm a human like: I\\\'m a human Then stripslashes only takes one set away: I\'m a human Quote Link to comment https://forums.phpfreaks.com/topic/149196-solved-slashes-problem/#findComment-783484 Share on other sites More sharing options...
shadiadiph Posted March 14, 2009 Author Share Posted March 14, 2009 mm seems to be working from the email side now send the email without the \'s but when i try to insert says jame's into my database it is saying it will not allow the insert because of the 's ?? I am inserting into my database as well as emailing the data. for example $client = stripslashes($_POST["client"]); $insert = " insert into tblmaildetails (type, sort, office, client, emailclient, subject, message, seen, sent, senttime, idkey) values ('email.php', 'Email', '$office', '$client', '$emailclient', '$subj', '$message', 'No', now(), now(), '$random')"; $DB_site->query($insert); Quote Link to comment https://forums.phpfreaks.com/topic/149196-solved-slashes-problem/#findComment-784446 Share on other sites More sharing options...
shadiadiph Posted March 14, 2009 Author Share Posted March 14, 2009 mm solved the problem found that the problem was i was using strtolower and ucwords and stripslashes in the wrong order i was puting stripslashes first so everytime i asked it to do something it was adding another / to it. So I now hav stripslashes slashes last in the chain but mysql_real_escape_string( also then adds another / before adding it to the database so where i have it displayed after this i have to strip it again. Quote Link to comment https://forums.phpfreaks.com/topic/149196-solved-slashes-problem/#findComment-784470 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.