walnoot Posted May 20, 2006 Share Posted May 20, 2006 Hi guys,I have created a news system based on php and mysql.now my problem is that when i fill in the form to insert de 'news' into my database, it inserts the text in 'html'-code.[b]so what I mean is this:[/b]this is what i type in my form to insert into the database: (for example)[code]This is my new news post<br><br><br><b>Down down down</b><br><br><br>Under :)[/code][b]And this is what i get when i read it from the database news table:[/b]"This is my new news post[b]Down down down[/b]Under :)"[b]NOW what i want to be able to do is i want to type this in my form (you see, without the html codes like '<br>'):[/b][code]This is my new news postDown down downUnder :)[/code][b]and i want to get the same out of it:[/b]"This is my new news postDown down downUnder :)"------------------------------------------------------------------------------------------------------------[b]When I type this in the form now and i read it again from the database, i get this:[/b]"This is my new news postDown down downUnder :)"(no '<br>') [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] hope you can help methanks Quote Link to comment https://forums.phpfreaks.com/topic/10059-insert-into-mysql-database-everything-is-in-html/ Share on other sites More sharing options...
AndyB Posted May 20, 2006 Share Posted May 20, 2006 Use the nl2br() function to display data back to your page.[a href=\"http://ca.php.net/manual/en/function.nl2br.php\" target=\"_blank\"]http://ca.php.net/manual/en/function.nl2br.php[/a] Quote Link to comment https://forums.phpfreaks.com/topic/10059-insert-into-mysql-database-everything-is-in-html/#findComment-37412 Share on other sites More sharing options...
walnoot Posted May 26, 2006 Author Share Posted May 26, 2006 Thanks that worked great :) Quote Link to comment https://forums.phpfreaks.com/topic/10059-insert-into-mysql-database-everything-is-in-html/#findComment-39220 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.