Emperio Posted April 13, 2011 Share Posted April 13, 2011 Hi all, I have implemented a WYSIWYG in my admin panel, here i can write text and customize it how i want it and then convert it to a html code and save it in my mysql database. Now I want to let other people see the text in the homepage, but it is showing this text very wrong functions like this <p> <b> <strong> <font> arent working. For example I make text <b>title</b> <strong> blabla bla bla </strong> then the text becomes like this litterly "<b>title<b> <strong> blabla bla bla </strong> " the codes have no effect and are seen as text in the homepage. My question is how is this possible and how can i fix this, thanks. The code on my homepage is like this <?php $tekst="SELECT * from homepage where id='1'"; $tekst2=mysql_query($tekst) or die("unable to connect"); $tekst3=mysql_fetch_array($tekst2); print "$tekst3[tekst]"; ?> Link to comment https://forums.phpfreaks.com/topic/233595-getting-text-from-mysql-putting-it-in-webpage/ Share on other sites More sharing options...
trq Posted April 13, 2011 Share Posted April 13, 2011 We need to see relevant code. Link to comment https://forums.phpfreaks.com/topic/233595-getting-text-from-mysql-putting-it-in-webpage/#findComment-1201084 Share on other sites More sharing options...
Emperio Posted April 13, 2011 Author Share Posted April 13, 2011 ops sorry, i've added the current code on homepage now. Link to comment https://forums.phpfreaks.com/topic/233595-getting-text-from-mysql-putting-it-in-webpage/#findComment-1201087 Share on other sites More sharing options...
Emperio Posted April 13, 2011 Author Share Posted April 13, 2011 Up.. Link to comment https://forums.phpfreaks.com/topic/233595-getting-text-from-mysql-putting-it-in-webpage/#findComment-1201300 Share on other sites More sharing options...
dcro2 Posted April 13, 2011 Share Posted April 13, 2011 How does it appear in the html source (in your browser)? Link to comment https://forums.phpfreaks.com/topic/233595-getting-text-from-mysql-putting-it-in-webpage/#findComment-1201311 Share on other sites More sharing options...
Emperio Posted April 13, 2011 Author Share Posted April 13, 2011 Like this <p><span style="font-size: large; font-family: comic sans ms,sans-serif;">Title: Example tekst</span></p> <p><span style="color: #ff0000;">Name: Emperio</span></p> <p><strong>This is example text to let you guys show the error.</strong></p> <p>The End.</p> Link to comment https://forums.phpfreaks.com/topic/233595-getting-text-from-mysql-putting-it-in-webpage/#findComment-1201314 Share on other sites More sharing options...
Emperio Posted April 13, 2011 Author Share Posted April 13, 2011 hmm i got it i need to use htmlspecialchars_decode Link to comment https://forums.phpfreaks.com/topic/233595-getting-text-from-mysql-putting-it-in-webpage/#findComment-1201330 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.