Jump to content

Help Inserting HTML into DB


refiking

Recommended Posts

What can I do to insert html into the db?  Is it a setting on my db field or something?  Can't think of anything else it might be.  Here's what I've tried from a programming vantage point:

 

1) addslashes

2) mysql_escape_string

3) mysql_real_escape_string

4) htmlentities

 

All of them provided the same response in the db ultimately. Here is an example entry

<p>
Hey,</p>
<p>
How's it goin?  I've got a couple surefire upset picks for you.  When can we go over them?</p>

Link to comment
https://forums.phpfreaks.com/topic/209613-help-inserting-html-into-db/
Share on other sites

try setting your tables (rows, columns) or more specifically at least where your storing your html to "utf 8 general case insensitive"

 

You can also make your own filters. Where you find key tags in the HTML you want to convert specificly. and do str_replace type of thing on them when they go into the database and store them like bbcode. then when you pull the info out from the database you reverse the technique to covert your new BB code or version there of to change it back to standard HTML

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.