HTML forum format input to
Posted 26 May 2006 - 04:05 AM
Posted 26 May 2006 - 05:06 AM
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.
[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\" /]
Posted 04 June 2006 - 07:50 PM
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...xauckland.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().
$postmessage = nl2br(htmlentities($postmessage))
I know this is a 2 part post but if any one could please point me in the right derection.
The PHP nub, Daguse!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users