Computing.Net > Forums > Web Development > Allow user to apply CSS templates

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Allow user to apply CSS templates

Reply to Message Icon

Name: tan
Date: April 26, 2005 at 20:32:27 Pacific
OS: XP
CPU/Ram: 512
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: April 26, 2005 at 23:32:42 Pacific
Reply:

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


0

Response Number 2
Name: fambi
Date: April 28, 2005 at 15:26:32 Pacific
Reply:

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">

Visit tm4b.com if you would like to send sms or bulk sms.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Urgent need of webspace..... what about the new domain...



Post Locked

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


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Allow user to apply CSS templates

user choose CSS howto www.computing.net/answers/webdevel/user-choose-css-howto/1071.html

Apply CSS across entire site DreamW www.computing.net/answers/webdevel/apply-css-across-entire-site-dreamw/3208.html

Free Program For Webpage Protection www.computing.net/answers/webdevel/free-program-for-webpage-protection/3056.html