Hello, this may be a really simple question or complex im not to sure. I have been working with PHP and MYSQL for a while but im not to say an expert.
I got the front end to work, and for it to post but when it post it doesn't post the formatted text, it only posts the code. For an example say something was in BOLD like this. When displaying the data that is returned, the code which is the b and the /b is shown. Basically i send $postedValue into a MYSQL table. and it works in that sense and then i want to return that information like so:
mysql_connect($ip, $user, $pass) or die(mysql_error()); mysql_select_db("$user") or die(mysql_error()); $query = "SELECT * FROM news"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $news = $row['news']; } echo "$news";
it will just display the code. Ive looked at the code it returns and to me it looks like it should work but all it does is display the code. Im probably missing something VERY simple like a line or a phrase at the start before $news.
Thanks for all the help guys! In advance and will thank again, i hope this is enough information.
XCore
P.S {http://www.dynamitecheer.com/ is the website you can see the code on the front page}
Re: Not formatting HTML in PHP (EXTREME DETAIL)
Re: Not formatting HTML in PHP (EXTREME DETAIL)
so i would use this htmlspecialchars says RIGHT before i insert it into the database. then when i recall it will show up as it is suppose to be?
Re: Not formatting HTML in PHP (EXTREME DETAIL)
So now what?
Re: Not formatting HTML in PHP (EXTREME DETAIL)
When somebody else edits HTML, you need to handle the output depending on who's the author and what functionality is being used. For example, in a form post like this one, you want to HTML-encode everything and then process BB-codes to render strings in bold, etc. Some sites accept HTML (as opposed to BB codes), but only allow some tags, like <b> and <i> in the HTML produced by the editor.
Re: Not formatting HTML in PHP (EXTREME DETAIL)
Ok like i said im not an expert. So i am confused, what EXACTLY do i have to do, what do i have to type?
I have checked the database and your right it looks all weird:
Its barely understandable.
What exactly do i have to do $postedValue or $Value.
Not in words but what code. This is all i need to do to finish my website. No joke.
Wat your saying is not really making sense, and from what im getting its probably only a few lines. SO please can you help me or link me to a URL that will tell me what to do.
I know im sounding needy but i need help. Thanks
Re: Not formatting HTML in PHP (EXTREME DETAIL)
Ive tried only you can help me.
Re: Not formatting HTML in PHP (EXTREME DETAIL)
And now verything works.
Re: Not formatting HTML in PHP (EXTREME DETAIL)