Page 1 of 1

simple input formatting questions

Posted: Fri Aug 29, 2008 4:49 pm
by icecold
hello,

i have a contact form with an input (multi line text box), when i merely pass the raw input into the email body i receive it fine; carriage returns in particular work ("\r\n) and so a multi lined input message appears multi lined in the email.

but, when i filter the input through strip_tags and then mysql_real_escape_string the email opens with the "\r\n" bits visible and the message all on one line.

what is it about strip_tags or mysql_real_escape_string that causes the "\r\n" to not work, even though they are there?

thanks

Re: simple input formatting questions

Posted: Fri Aug 29, 2008 5:29 pm
by alfredwong
i think strip_tags do that.

i use another one too:

$order = array("\r\n", "\r", "\n");
$answer_text = str_replace($order, " ", $answer);

This will take off the '\r' and '\n'.

Don't know is it what you need.
But hope this will help