Page 1 of 1

problem with my textarea field

Posted: Tue May 11, 2010 7:22 pm
by adsegzy
Hello friends,

AM having a problem with my textarea field of my feedback form. My feedback form requires name, email and message. Using PHP scripting. if any of the 3 fields is not filled it will retuen the page with the content of the field that was filled but the way its displaying the content if the textarea is confusing to the visitors (though am still testing on my local PC). Eg let's assume the visitor enter the below content into the textarea;
Hello,

AM just testing this feedback form.

Regards
If the visitor failed to fill the other fields (name or email) and the server will have to return the page for completion, what will appear on the textarea is
Hello,\r\n\r\nAM just testing this feedback form.\r\n\r\nRegards
and this could be confusing to visitors.

please what is the way out.

regards

Re: problem with my textarea field

Posted: Tue May 11, 2010 8:00 pm
by Christopher
Do you escape the output with htmlspecialchars() or other function?

Re: problem with my textarea field

Posted: Thu May 13, 2010 6:18 pm
by adsegzy
No. i named the field 'message', so i used

Code: Select all

<?php echo nl2br($message); ?>