Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Please help... :)
I have a website (using PHP) where users can create their own profiles for other users to view. I would like to create some CSS templates / themes that they can choose from to change the look of their profile page.
I would like the style to be applied to a page so that everyone who views it sees it in that style. All the info I've found so far has been for the user preference in a cookie only, not to change the page permanantly to all who view it.
I suppose this would involve writing a value to the database so the style sheet is linked to that page via the database value.
Any hints on how I go about setting this up? It's pretty new to me, all help would be vastly appreciated.
Many thanks!! Hope it makes sense.

Well you could just write the following to the page for the stylesheet:
<link rel="stylesheet" type="text/css" href="<?php echo $styleSheet?>">
You would need to do a database query prior to that line and assign the name of the style sheet to the variable $styleSheet.
If you do not know how to insert and select records from a database, then that is beyond the scope of replies here. Find a tutorial on PHP and databases to get started.
Michael J

Also... be mindful to include the css extension within the database, or else your html should look like
<link rel="stylesheet" type="text/css" href="<?php echo $styleSheet?>.css">

![]() |
Urgent need of webspace.....
|
what about the new domain...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |