Re: [css-d] PHP and CSS
Sarah Atkinson wrote on 05/13/2005 10:25:55 AM: Out of curiosity can you use PHP with in a CSS. Like maybe have a list of background images located in a DB and PHP select and insert on into the CSS. and possibly even have the user define things like font size, font color, background color, and typeface. Sarah It's my understanding that this is not possible, unless the PHP is in your .php document, as well as the CSS that is going to be altered. Placing PHP code in a .css file does no good unless your server knows the parse .css files as PHP. If that's the case, then I don't see why it couldn't work in an external file, though I don't have the resources to test it right now. __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] PHP and CSS
Sarah Atkinson wrote: Out of curiosity can you use PHP with in a CSS. Like maybe have a list of background images located in a DB and PHP select and insert on into the CSS. and possibly even have the user define things like font size, font color, background color, and typeface. Sarah You can actually do a style.php and format it like a document specific stylesheet but I think you then have trouble validating a stylesheet, well maybe not it would be included in a page like ? include('style.php') ;? and it would just look like this in the page: head tags all up in here style type=text/css !-- .classofsomesorts {font-face: Geneva; etc} -- /style And when the php file is rendered the databased info and dynamic stuff is of course not viewable to sneaky source readers. Jack Keller | cell7.org __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] PHP and CSS
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sarah Atkinson wrote: Out of curiosity can you use PHP with in a CSS. Like maybe have a list of background images located in a DB and PHP select and insert on into the CSS. and possibly even have the user define things like font size, font color, background color, and typeface. Sarah Of coure you can do this. There are two posibilities: - - Inline Css, that's the way Brian wrote about, and - - a separate stylesheet, If you use a separate stylesheet, who can use a php document (for ex. style.php) which gets parsed by the webserver, and then just include this file from your main (x)html file. (either with @import or a link tag, which ever you like more) Marko - -- Marko Locher Kollegium Kalksburg KKnet System Betreuung [EMAIL PROTECTED] http://www.kk.asn-wien.ac.at/kknet/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFChNQRyja8NOV8jDYRAr/UAJsHHcSIRVawmuv7pzEriSNzlHcaGACfVJ2A KoBUvN9U7GE25kYkQG5Y+K4= =8bVr -END PGP SIGNATURE- __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] PHP and CSS
Quoting [EMAIL PROTECTED]: Sarah Atkinson wrote on 05/13/2005 10:25:55 AM: Out of curiosity can you use PHP with in a CSS. Like maybe have a list of background images located in a DB and PHP select and insert on into the CSS. and possibly even have the user define things like font size, font color, background color, and typeface. Sarah It's my understanding that this is not possible, unless the PHP is in your .php document, as well as the CSS that is going to be altered. Placing PHP code in a .css file does no good unless your server knows the parse .css files as PHP. If that's the case, then I don't see why it couldn't work in an external file, though I don't have the resources to test it right now. Actually, if you can set up your webserver to process you CSS files by PHP, it is possible. You just have to output the correct header first. See http://codewalkers.com/tutorials/75/1.html for a good write-up about this. Ken __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/