Daguse Posted May 26, 2006 Share Posted May 26, 2006 Ok I need to take a block of text from a HTML forum textarea and save it as is, with line breaks and all. Now I already use htmlentities() but it does not save the line breaks. I am going upload this to a mysql DB. How would I do this. Thanks for your help. Link to comment https://forums.phpfreaks.com/topic/10479-html-forum-format-input-to/ Share on other sites More sharing options...
poirot Posted May 26, 2006 Share Posted May 26, 2006 [!--quoteo(post=377214:date=May 25 2006, 09:05 PM:name=Daguse)--][div class=\'quotetop\']QUOTE(Daguse @ May 25 2006, 09:05 PM) [snapback]377214[/snapback][/div][div class=\'quotemain\'][!--quotec--]Ok I need to take a block of text from a HTML forum textarea and save it as is, with line breaks and all. Now I already use htmlentities() but it does not save the line breaks. I am going upload this to a mysql DB. How would I do this. Thanks for your help.[/quote][a href=\"http://www.php.net/nl2br\" target=\"_blank\"]http://www.php.net/nl2br[/a] [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /] Link to comment https://forums.phpfreaks.com/topic/10479-html-forum-format-input-to/#findComment-39106 Share on other sites More sharing options...
Daguse Posted June 4, 2006 Author Share Posted June 4, 2006 Thanks, poirot!nl2br works great, but I have found two more problems. 1st! When I go back to edit the forum I see the <Br/> rather the the line break it self. To edit it the forum I just set the value to the value from the SQL db. So the script will look like <TEXTAREA>$postmessage</TEXTAREA>. So is there a way to set <br/> to make a line break in the Textarea?2nd! Is there a way to set up htmlentities() so that I can post image and link tags in HTML formate? So say I post Check out this "G4 Mailbox" <img src="http://craphound.com/images/g4mailboxauckland.jpg">how to I set it up so it will post the text with the "" and other HTML thing but still post the image? When posting I have the post wraped with nl2br() and htmlentities(). [code]$postmessage = nl2br(htmlentities($postmessage))[/code] I know this is a 2 part post but if any one could please point me in the right derection. Thank you!The PHP nub, Daguse! Link to comment https://forums.phpfreaks.com/topic/10479-html-forum-format-input-to/#findComment-41837 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.