EchoFool Posted June 21, 2009 Share Posted June 21, 2009 I have a message system which inputs messsages to a database with these functions attatched to it: mysql_real_escape_string(stripslashes($_POST['letter'])); And on the ouput page i have: $Output = ucfirst(nl2br(strip_tags($row['Goals']))); echo $Output; But on the page in my browser it shows strange slashes some times... like this: for the best success.\\\\r\\\\n\\\\r\\\\nexplore the ocean waves What is it that causes that part in bold? Link to comment https://forums.phpfreaks.com/topic/163169-solved-problems-with-input-and-outputs/ Share on other sites More sharing options...
EchoFool Posted June 21, 2009 Author Share Posted June 21, 2009 bump Link to comment https://forums.phpfreaks.com/topic/163169-solved-problems-with-input-and-outputs/#findComment-860907 Share on other sites More sharing options...
EchoFool Posted June 22, 2009 Author Share Posted June 22, 2009 bump Link to comment https://forums.phpfreaks.com/topic/163169-solved-problems-with-input-and-outputs/#findComment-861282 Share on other sites More sharing options...
gevans Posted June 22, 2009 Share Posted June 22, 2009 You shouldn't need to strip slashes unless magic quotes is turned on, which it shouldn't be. Perhaps doing it this way round will work better for you; <?php //input $input = mysql_real_escape_string(nl2br(strp_tags($_POST['letter']))); //output $output = ucfirst($row['Goals']); echo $output; If magic quotes is turned on, I'd turn it off. Also check the string once its stored in the db to see if it's being stored as expected. Link to comment https://forums.phpfreaks.com/topic/163169-solved-problems-with-input-and-outputs/#findComment-861299 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.