Hey Guys, Can anyone help me out? I am trying to go for a user changeable background type of thing like tweeter has, but I'm not sure how to go about it exactly. Like, I've done backgrounds that change depending on a page, but have never done one that allows to the user to specify it. I suppose I would need to deal with either a database here or cookies or something as well as PHP in order for the user to be able to either pick a predefined image or upload one. Can someone please help? Regards, Nick
Yep you'd first need a register/login system, so there are users which can login with user and pass... Then the user can have their own page where they choose the background (or upload) Then on the page where you want to change the background you simply pull their background choice from the database and echo it into the CSS. So you'd need a database, with a users table, which has columns for login, password, and their background choice (or you could add this in another table if you wanted).
What I've done in the past is have a users table and a settings table. Each row in the settings table has the username and all their decisions (bg, public or private info, etc). Makes it very easy to change stuff and make it as they want it.
echo '<style type="text/css">'; if($userburl){ echo "background-image:url($userburl)"; }else{ echo "background-color:#$userbgcolor"; } echo '</style>'; PHP: where you have a form that goes to there page /?userbgcolor=xxxxxx or /?userburl=http://example.com/image.php or gets the variables off a database