Jump to content

[SOLVED] Problems with input and outputs


EchoFool

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.