I’m retrieving some info from a database and I’d like to display a different coloured background and/or image on my webpage, based on the specific value contained in the url.
$q = “SELECT name FROM forum WHERE name = ‘$name’”;
For example, if the url contains the name ‘Peter’ then the page will load with a blue background; if the url contains the name ‘Sarah’ a pink background will load. A lame example but thats all I got.
If, as you stated, you want the whole page to change color based on the user I would suggest adding a field in the database (for each row) that contains the color.
Then you retrieve the color field from the record (along with the user name)
Another way to accomplish this would be to define a CSS stylesheet for each user. Then use code like this: