I don't know how to solve a strange bug. In textarea, the newline uses rn (ckeditor is also used), but str_replace () cannot be used to process rn. why .? In phptextarea, rn is used for line feed and str_repl is used.
In textarea, \ r \ n (ckeditor is also used) is used for line feed, but \ r \ n cannot be processed with str_replace (). I don't know why.
// The newline in textarea uses \ r \ n, and the str_replace method cannot be used !!
// The test1 table only has two fields: id and textarea, and only one record with id = 1.
Require_once 'connect _ text. php ';
Require_once 'show _ message. php ';
If ($ _ POST ['text']) {
$ Text = str_replace ('\ r \ n', '', $ _ POST ['text']);// Try to get rid of it. \ r \ n is not removed from the test result
$ Query = "UPDATE test1 SET textarea = '$ text' WHERE id = '1 '";
$ Result = mysql_query ($ query );
If ($ result ){
Echo "script" alert ('is! ') Script ";
}
}
$ Query = "SELECT textarea FROM test1 WHERE id = '1 '";
$ Result = mysql_query ($ query );
$ Row = mysql_fetch_array ($ result );
?>
Partition (ckeditor is also), but cannot use str_replace () to process \ r \ n. I don't know why. ? In php // textarea, the newline adopts \ r \ n and str_repl...