Accurax Posted January 11, 2007 Share Posted January 11, 2007 Here is an example of my code:[code] <table align ="center" id="description_tab"><tr> <td> <form method="POST" action= "update_bandtype.php"> <textarea name="intro" cols="50" size="100"></textarea> </form></td></tr><tr><td colspan="2" align ="center"><input name="submit" type="submit" value="Update" /></td></tr> </table>[/code]The above form submits the entered text into a MYsql database, and i make queries to this database on other pages.I have two problems here,1) html is accepted in the text area, stored in the database and then processed whenever i call the information, I would like to Ignore html, or for that matter everything except harmeless text :)2) Keystroke formatting does not work, if the user hits return to go to a new line in the text area, this is not stored in the database, and all formatting is lost when i re-call the info later. However html formatting does work (see point 1).Does anyone know how id go about doing this please ?? Link to comment https://forums.phpfreaks.com/topic/33745-auto-storing-the-formatting-in-text-fields/ Share on other sites More sharing options...
trq Posted January 11, 2007 Share Posted January 11, 2007 1. [url=http://php.net/strip_tags]strip_tags[/url]().2. [url=http://php.net/nl2br]nl2br[/url]().Its amazing what you'll find in the manual. Link to comment https://forums.phpfreaks.com/topic/33745-auto-storing-the-formatting-in-text-fields/#findComment-158234 Share on other sites More sharing options...
Accurax Posted January 11, 2007 Author Share Posted January 11, 2007 ahh so thats what they dopmsli did wonderthanks mate Link to comment https://forums.phpfreaks.com/topic/33745-auto-storing-the-formatting-in-text-fields/#findComment-158236 Share on other sites More sharing options...
Accurax Posted January 11, 2007 Author Share Posted January 11, 2007 Ok, i have it working... kind ofwhen i use nl2br() to add line breaks, it actually echos "<br />" onto the screen when i call the information ... is it possible to get it to just start a new line without showing the tag? Link to comment https://forums.phpfreaks.com/topic/33745-auto-storing-the-formatting-in-text-fields/#findComment-158255 Share on other sites More sharing options...
trq Posted January 11, 2007 Share Posted January 11, 2007 Post you code and the exact html output (ie right click and view source). Link to comment https://forums.phpfreaks.com/topic/33745-auto-storing-the-formatting-in-text-fields/#findComment-158299 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.