mysql real escape string - PHP Sanitized markdown - html output -



mysql real escape string - PHP Sanitized markdown - html output -

i have wmd editor on site, , store markdown in db. before send markdown database filter mysql_real_escape_string, that:

$to_database = mysql_real_escape_string($_post['markdown']);

and it's okay. want show it, utilize php markdown (which converts markdown html). problem shows me \r\n , \n instead of new lines. tried nl2br function, didn't help. if not escape output (do not convert markdown html , using htmlpurifier) still \n instead of new lines. when remove mysql_real_escape_string looks fine.

bbbbbbbbbbb nnnnnnnnn

they beingness converted , no longer acting line breaks. want replace them:

$markdown = str_replace('\r\n','<br/>',$_post['markdown']); $markdown = str_replace('\n','<br/>',$markdown);

you might want this:

$markdown = html_entity_decode($markdown);

php mysql-real-escape-string wmd-editor wmd-markdown

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -