BOLD
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";

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)
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)