The forum operates in read-only mode. Please head to StackOverflow for support.
$actualites_message = (isset($_POST['actualites_message'])) ? trim(mysql_real_escape_string(nr_to_br(htmlspecialchars($_POST['actualites_message'])))) : $actualites_message_bdd;
INSERT INTO $table VALUES ('', '".$titre_message."', '".strip_tags($actualites_message)."', '".strip_tags($corps_message)."', '".$template."', '".date('Y-m-d')."', '', '".$destinataires."');
$array = array("\r\n", "\r", "\n", "\l", "\r\n", "\r", "\n", "\l"); $contenuhtml_corps = stripslashes(htmlspecialchars_decode(utf8_decode(trim(mysql_real_escape_string(htmlspecialchars(str_replace($array, '', $_POST['corps_message'])))))));
Re: double carriage returns when email is sent
Sorry to make a reply so late, but I hope these explanations (php) will help you or somebody else ...
I tape a carriage return in the textarea with Shift + Return.
This is my variable initialized :
Here, nr_to_br replaces "\r\n" by "<br />" and $actualites_message_bdd comes from my MySQL database.
When I record it in my database, my SQL query looks like that :
But when I try to send by e-mail, a lot of <br> are added !
I have to change my variable $actualites_message before sending :
In fact, FCKEditor (and others rich text editors) converts carriage returns and line feeds in "\r\n" in encoded one "\r\n".
I think there is an easier solution but I haven't time enough to test it ... (remove htmlspecialchars, stripslashes, ...)