Jump to content

[SOLVED] Line breaks


Dane

Recommended Posts

Hey guys.

 

I am using mysql_real_escape_string and htmlentities

 

$var = mysql_real_escape_string(htmlentities($row['body']));

 

But when i enter a line break in my database <br />

 

It comes up with stuff like <br />/r/n

 

How can i add breaks into the data ill pulling out?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/79690-solved-line-breaks/
Share on other sites

You said your <br's were getting turned into newlines on the way into the db. nl2br should re-convert it back when the data is pulled out. You don't need to do MRES or htmlentities on the info coming back out. It should have been sanitized on the way in.

 

Kind of like addslashes going in, strip them coming out. you wouldn't addslashes going in, then addslashes again when you pull the data out.

 

PhREEEk

Link to comment
https://forums.phpfreaks.com/topic/79690-solved-line-breaks/#findComment-403567
Share on other sites

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.