Saving input from a form field into sql database varchar(255)... The input would be something like :
<a href="test.com">Author Name</a>
Bottom line is it will more than likely have html tags in it most of the time. When I retrieve and output from the database I get something like :
<a href="test.com">Author Name</a>
As this should be echo'ed as html it does not show properly on the page. Maybe I am just tired, but I cannot figure out how to output this as non-encoded so it is properly read by the browser.
Try this:
<?php
echo htmlspecialchars_decode("<a href="test.com">Author Name</a>");
?>
Why do you encode the html tags before inserting into the database?