Jump to content

Problem with html tags


Nine_

Recommended Posts

Hi all

I'm having a problem now. In my script, I have a form to post a message (like this one), when a user posts a message every thing goes fine, but there is a problem when retrieving a message from the database. Like if the message is just normal message then there is no error, but if a user posted some "HTML" tags with the message (like "</table>","</body>") then an error will appear, anyone please help me about this.

 

Nine

Link to comment
https://forums.phpfreaks.com/topic/111510-problem-with-html-tags/
Share on other sites

I also hope that you're sanitizing this input. By the sounds of things, you're giving people the freedom to enter whatever they like. Make sure you're using the:

 

mysql_real_escape_string() on ALL of the data coming in from your users.

 

So, your post could be:

 


$user_post = mysql_real_escape_string(htmlentities($_POST['users_forum_message']));

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.