SUNIL16 Posted May 1, 2009 Share Posted May 1, 2009 Hi friends, I am having a form in that users can send some information. i am able to get the values sent by users. but problem is if they used enter key for next line it is not coming its coming continuously without break. i want to display as it is the user sends. i am using print htmlentities($str1); function while retrieving. please give some suggestions. thanks Link to comment https://forums.phpfreaks.com/topic/156432-php-form-help/ Share on other sites More sharing options...
taith Posted May 1, 2009 Share Posted May 1, 2009 nl2br() Link to comment https://forums.phpfreaks.com/topic/156432-php-form-help/#findComment-823653 Share on other sites More sharing options...
SUNIL16 Posted May 1, 2009 Author Share Posted May 1, 2009 Thanks taith for your reply.. now its coming as it is. I am using print htmlentities($str1); functions bcoz if some one sends some html code or php code it should display the code not to run that code. means it has to take like comment. Is this nl2br() functions display code sent in form? Link to comment https://forums.phpfreaks.com/topic/156432-php-form-help/#findComment-823671 Share on other sites More sharing options...
taith Posted May 1, 2009 Share Posted May 1, 2009 no, nl2br() simply turns new linebreaks(textareas) into <br>s... after then... you can htmlentities() and then store it how you see fit Link to comment https://forums.phpfreaks.com/topic/156432-php-form-help/#findComment-823673 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.