我允许我的网站成员在文本框中发布一些关于自己的信息。为了使其更美观,我使用了nl2br
函数,类似于这样:
$text_of_area = nl2br($_POST['text_area_name']); //yeah, of course i use functions against xss, sql injection attacks
mysql_query("..."); //here I insert a text
But here is problem. I don't want to allow people to use more then one enter (br) allowed in text, so what can I do?