Jump to content

Recommended Posts

I saw something a few days ago searching around that was a function where you could specify which html tags are allowed, such as <img> or <br> but nothing else but I can't for the life of me find it anymore.  Am I making this up? 

Basically I'm trying to make it so people can't break my layout by coming in and posting </div></div></table> whatever.  But I don't want to disable html completely, I'd like <a> and <img> to work.  Also, if I allow them to use <a> and <img> how would I go about making sure that they're closed, so someone doesn't open an img tag like <img src="  and then post, screwing up the layout of the page. 

While we're on the subject of security type things, if I run my input through addslashes and mysql_real_escape_string before inserting into the DB, is it reasonably safe? 
Link to comment
https://forums.phpfreaks.com/topic/19778-function-limiting-html-tags/
Share on other sites

[quote author=Wintergreen link=topic=106962.msg428481#msg428481 date=1157468583]
While we're on the subject of security type things, if I run my input through addslashes and mysql_real_escape_string before inserting into the DB, is it reasonably safe? 
[/quote]

It's perfetcly safe if you escape it using that function first.
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.