Jump to content

my BUTT hurts, MySQL and <html> tags


Lodius2000

Recommended Posts

this problem is a pain in my butt

 

I am creating a blog cms, for my main content of an entry i frequently have html in the content of said entry, img tags, bold tags, br tags...

 

my problem is this, when I create an entry everything is peachy. it goes into the db, escapes dangerous characters, the whole nine yards

problem is, if I mispell or dont close a tag or any other myriad of crap i could do wrong while typing, editing doesnt work. no edits I make work, at all, not even in phpmyadmin, unless both the $title, and $article on the edit page are made of entirely text. its making me nuts.

 

I had a ticket open with my host and this was their response:

before inserting data to the database you should shield all special symbols, else query will not be executed successfully.

 

mysql_real_escape_string is what they are talking about right?

as you will see those are there in both files

 

what am I missing?

 

I have attached both the createentry.php and editentry.php files, they are about 150 lines each

 

i really appreciate the help

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/111618-my-butt-hurts-mysql-and-tags/
Share on other sites

ok heres try number 2, I was frustrated last night when I wrote the first post

 

how do you store formatted html in a mysql database AND make it editable (in case of typos)

 

my createentry.php page will put formatted html into the db, but my editentry.php, nor phpmyadmin will edit it.

 

it is as if once it is written to the database, the only way to change it would be to delete and reinsert the row, that is not what I want

 

could it be something with the multitudes of <> and "" in html that is messing with the database?, if so how do i avoid this problem?

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.