Creating a Dynamic PHP/CSS Page (newbie design question)
| From: | cool@hosting4days.com | Date: | Thu, 05 Nov 2009 16:06:36 +0000 |
| Subject: | Creating a Dynamic PHP/CSS Page (newbie design question) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-299648@lists.php.net to get a copy of this message | ||
Hi Folks,
My goal: is to have a template form to control css styles, where the user fills out choices in a template form page and the results might get stored in a MysQL prefs table.
But I guess you can't have php mixed with .CSS page ... so is the best way to do this like: ...?
- set a a normal mystyle.css style sheet with no php but with all possible choices
- then - on the css prefs form page you might have choices like:
fontsize = small or med or big etc. then you might store the 'actual' css name (on the real css style sheet) associated with the choice like :
style = "HEADER1" or whatever based on the choice
then let's say I have a page:
mypage.php
that links to a css style sheet:
mystyle.css
- then the php page might use it like:
class = "<?php echo $thischoice; ?>" for "HEADER1"
Q: Is that the best way to setup dynamic css choices using php?
Any comments would be appreciated - dave
Thanks,
cool@hosting4days.com