Welcome to WebmasterWorld Guest from 54.163.40.152

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

dynamic style sheets from DB

     

mikejs

10:57 am on Nov 10, 2009 (gmt 0)

5+ Year Member



Hi I would like to see if it is possible to have a database store css file sheets

e.g.

style1.css
style2.css

etc

then have a user id linked to a style

ID
username
password
style

thne basicaly when the page loads it will run a query and use the css sheet that matches the user

is there a way of having a difrent css loaded into a page ?

thanks

M

JohnCanyon

4:47 pm on Nov 10, 2009 (gmt 0)

10+ Year Member



Mikejs,

This is possible, just reference a php script to output your css instead of writing a .css file to the system.

<link rel="stylesheet" href="/pathtomyscript.php?css=1" />

//output of script...
header("Content-type: text/css");

//output the css
echo $result['css'];

 

Featured Threads

Hot Threads This Week

Hot Threads This Month