I have a textarea input on a form for users to submit their snail mail address.
This is the code I have <textarea name="Mail" rows="4" ></textarea>
I would like for the line breaks in the text area to be passed in the POST data so that the address will appear properly in the code echo $_POST['Mail'];
views:
103answers:
1Also, deter XSS with: `print nl2br(htmlentities($_POST['Mail']));` To explain the nl2br() further, the problem wasn't that newlines weren't being passed from the input, it's that newlines don't display as newlines in HTML in output.
Frank Farmer
2010-02-11 04:41:35
@Frank Farmer: i have kept my answer limited to the question, of course there are a host of considerations when it comes to security not just xss. thanks anyways
Sarfraz
2010-02-11 04:55:12