Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2010
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question What is the drawback of submittable css?

    What would be the drawback/s of allowing players to submit CSS to the database? I know its possible to run some sort of cdata inside css, but i do not use that kind of thing too much.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,312
    Thanks
    23
    Thanked 612 Times in 611 Posts
    If you want to do this why not have users upload a file, you store it in a common folder and generate a name for it, store the name of the file in the DB with user info. Then when you retrieve info check if they have a personal css file and load it after your css is finished.

  • #3
    New Coder
    Join Date
    Oct 2010
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Why in the world would i let them send me a file, i just want them to be able to enter in CSS so they can change the background colors how they please (gradients and what not).

  • #4
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,758
    Thanks
    41
    Thanked 191 Times in 190 Posts
    i don't see a major issue with doing such a thing provided you have your security locked down... (the CDATA is for <style> css)
    but if somewere to do something like
    Code:
    select * from tbl_users
    and saved it as mycss.css and then you now upload that SQL script to your DB you now have a nifty way to allow anyone to upload any code they want to the DB... now they only need a way to open the file and read the contents which can be done in a few lines of code... of course you will always hit issues like this allowing anyone access to your DB, and handling this sort of thing is usually done by an experienced DBA... but just food for thought...

    a better method would be to make custom CSS files and then the user selects which one they want to use based off of a value in a checkbox and then you apply accordingly... then allow them to send you their CSS files for review for submission... I am not 100% on this (bc I don't have a tmblr) but I am pretty sure they do a similar process for theme submitting...
    i guess my main point in posting this is that based on the question you may be unaware the risks

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #5
    New Coder
    Join Date
    Oct 2010
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your reply, i was hoping to steer away from having to make up some layouts for them to choose from, but it might be the best way. Thanks again.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •