Jump to content

Recommended Posts

hi guys, well im building a small forum jsut because i can, and i was wondering how on phpfreaks can you have it so that people can use html tags, and yet still have the forum secure?

 

how do you stop sql injections, people including frame breakout pages through iframes ect

Link to comment
https://forums.phpfreaks.com/topic/101818-building-a-forum-as-a-hobby-project/
Share on other sites

We didn't create the forum, so this is just guesses. There is probably a whitelist of HTML tags which are allowed while the remaining are being converted to HTML entities. SQL injections are probably taken care of with a function like mysql_real_escape_string(). The iframes thing would be the same solution as the HTML tags.

On the forum source codes that I've seen, they will have a white list of tags, and then strip out all of the attributes out of the tag, especially the JavaScript events attributes ( like onmouseover, onmouseout, etc ) and then rebuild the tag with only the allowed attributes and data.

 

PunBB is a lightweight forum program that fast, clean, correct and easy to read/modify the source. If you have questions on how things are usally done in forum software, I would highly reccommend studying the PunBB source code.

 

http://punbb.org/

 

  • 2 weeks later...
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.