开发者

\r\n\r\n Strings Getting Into Plain Text

开发者 https://www.devze.com 2023-02-08 05:17 出处:网络
I am facing an issue of using form input that I need to send as a text email and then put into the database.

I am facing an issue of using form input that I need to send as a text email and then put into the database.

When I send it as a text email, the newline characters show up as \r\n\r\n in the plain text email, but do not show up like that when stored in the DB.

I am using PHP/MySQL - what 开发者_JAVA技巧would be the fix to stop the \r\n\r\n characters from showing up in the email that gets sent out?

Thank you, Alex


send the email as text/html and use

<p> or <br>

tags


A possible cause of this might be database sanitizing (like mysqli_real_escape_string). I've done the same mistake by systematically sanitizing even variables that were never passed to the database.

0

精彩评论

暂无评论...
验证码 换一张
取 消