I have this when posting to a database:
[PHP]$a = htmlspecialchar s($_POST['article']);
$a = addslashes($a);[/PHP]
I have this when displaying the data on a Web page:
[PHP]$article=nl2br( stripslashes(my sql_result($res ult,$i,"article ")));[/PHP]
The stripslashes works, but the html characters show up, i.e. < >, etc.
htmlspecialchar s going into the database is good, but how do I reverse it to display in a Web page?
Thanks.
[PHP]$a = htmlspecialchar s($_POST['article']);
$a = addslashes($a);[/PHP]
I have this when displaying the data on a Web page:
[PHP]$article=nl2br( stripslashes(my sql_result($res ult,$i,"article ")));[/PHP]
The stripslashes works, but the html characters show up, i.e. < >, etc.
htmlspecialchar s going into the database is good, but how do I reverse it to display in a Web page?
Thanks.
Comment