Jump to content

Recommended Posts

So, I have a simple AJAX chat which I run on my website, but this post doesn't concern the AJAX at all, when inserting the message into my database using PHP + MySQL, I use the PHP function strip_tags(). But as this is a chat, this is rather innapropriate, as if a user sends message using a common emoticon (>.< for example), the < will be removed. There are several other common characters which are removed when used in chat, such as the plus sign.

 

Basically, I'm looking for a way to stop users from being able to insert HTML code into chat, without impeding the characters they can use typing a standard message. If there is a way to do it, I figured this would be the place to find out what it was. Even just a point in the right direction would be appreciated.

 

Thanks in advance for any replies :)

 

~Glenugie~

Link to comment
https://forums.phpfreaks.com/topic/190291-html-tag-stripping-from-a-chat-message/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.