\r\n being added to textfield result in PHP/HTML form

xorexdz

New Member
I have a text area in a form that does this:\[code\]<textarea rows="4" name="message"></textarea>\[/code\]In PHP, when form is submitted, this happens:\[code\] $text_form = $database -> escape_value($_POST['message']);\[/code\]Then it is sent as part of an email message using PHPMailer:\[code\]$message .= '<p style="font-family: Arial, verdana, sans-serif;"><strong>Brief Message</strong>: ' . $text_form . '</p>';\[/code\]Last here, is my database method referred to above:\[code\]public function escape_value($value) { if ( $this->real_escape_string_exisits ) { if ( $this->magic_quotes_active ) { $value = http://stackoverflow.com/questions/14575638/stripslashes( $value ); } $value = mysql_real_escape_string($value); } else { if (!$this->magic_quotes_active ) { $value = addslashes( $value ); } } return $value; }\[/code\]This above method is virtually copied from a Lynda.com tutorial, line by line.Now on the email, if the user hits return in the text field, he gets thisHere is line one. Now I will press return here.\r\nThis is the new lineWhy is there a \r\n being added? I understand what those mean, but why do they show up?
 
Top