Jump to content

Recommended Posts

Hi Guys,

 

i'm thinking of doing a cut down version of a myspace/community type site, planning it on paper just now but 1 thing i can't figure out is how the users add html to the dynamic pages, i take it the html is stored in myslq (in the users membership details) just to echo out like any other piece of information you grab from mysql but would that not disrupt the entire layout of the site for the user if thay put in non-proper code? is there a better way i could do this?

 

any info or advide would be appreciated

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/70501-advice-on-myspace-type-site/
Share on other sites

Yes. You'll have to use some regular expression to test for improper tags, tags which aren't closed ect. For example you wouldn't want any <body>, <head> or <title> tags. So strip those...

 

 

Further more you would want your users "site" to be contained within a single div or something like that so it can't mess up the entire site :)

He could but that would pose a greater risk than a messed up layout. If he evaluate user submitted php without disallowing certain functions the user would be able to delete files ect.

 

But cool idea... it's certainly doable :)

At the moment, they can use anything they want, a whole section of site just mimics a directory set full of php pages which are wrapped up into a cms template... But I know what you mean and it is possible to parse out offending words, however I want it so that script structure is not damaged and errors out (e.g. thinking about spliting on ';' and then checking each line, but not sure, future devs!).

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.