Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying html code from mysql

Status
Not open for further replies.

bccamp

Technical User
Jan 20, 2005
69
I have links and images stored in a mysql db that I am trying to display in code form after reading from the db. The code is in the form
Code:
<a href="page">link</a>

I want to read it from the db and display it in that form. I am creating a record addition/editing form, and this is for the editing portion. After displaying and editing, I then want to write it back to the db in the correct, edited form.

So far, I can either display the link, or strip the tags and display the text. I want to display the whole code. What's the easiest way to go about this?

Thanks
 
echo "<a href='$dbdata'>link</a>";

Or within HTML

<a href="<?=$dbdata?>">link</a>
 
Thanks, but I figured out what I was looking for:
db contains $value
Code:
translate=get_html_translation_table(HTML_ENTITIES);
echo strtr ($value, $translate);

This gives me the true, uninterpreted, code for $value, not the browser rendered link.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top