User set backgrounds?

Ello all,

I was wondering how would i go about this little task,

so say i have an image called background.png, i want my users to be able to upload an image which saves (my guess is i need to store it in a database) for the user and replaces the default image

Absolutely. You’ll need some way of identifying the user, so at some point they’ll have to sign in and upload the image. At that point I think I’d look at creating a cookie so your site can identify the user when they return (although some will disable cookies) and then each of your pages will need to establish the user id, find out whether they have a custom background image, and output it as part of the page if they do. Presumably your background will be defined in the overall site CSS, so it will be just a case of overriding it in the page header.

Thank you for the reply! :slight_smile:

You’ll also want to check for the image type (jpg, png), and size in pixels to restrict what they’re allowed to upload.