HTML tags in database

A

Amos King

I put html tags in a longtext field in my database, but when I grab it
for the page it uses it as regualr text. How can I get the html tags
to be recognized?
 
G

Gregory Brown

I put html tags in a longtext field in my database, but when I grab it
for the page it uses it as regualr text. How can I get the html tags
to be recognized?

Can you show some specifc code please? There isn't enough context
here for us to help you.
 
C

Carlos

Amos said:
I put html tags in a longtext field in my database, but when I grab it
for the page it uses it as regualr text. How can I get the html tags
to be recognized?

You are probably escaping "<", ">" and "&". Just don't do that.
--
 
A

Amos King

Can you show some specifc code please? There isn't enough context
here for us to help you.

sure

<table>
<tr>
<td><%= post.body %></td>
</tr>
</table>

body may look like:

Hello, I'm a <a href="www.google.com">link</a>!

I want the html to be interpreted, but it is showing up as text in my
browser so link is not a link.
 
A

Amos King

I put html tags in a longtext field in my database, but when I grab it
for the page it uses it as regualr text. How can I get the html tags
to be recognized?

rhtml looks like:

<table>
<tr>
<td><%= post.body %></td>
</tr>
</table>

body may look like:

Hello, I'm a <a href="www.google.com">link</a>!

output:

Hello, I'm a <a href="www.google.com">link</a>!

I want the html to be interpreted, but it is showing up as text in my
browser so link is not a link.

Does anyone know of a way to accomplish this.

Thanks
Amos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,214
Messages
2,571,110
Members
47,702
Latest member
gancflex

Latest Threads

Top