on 04/03/03 5:37 PM, Phillip S. Baker ([EMAIL PROTECTED]) wrote:
> I would like to use PHP to make calls from a DB and generate a CSS file.
> Anyone have any ideas on doing this?
every day :)
PHP is some kind of programming language which is PARSED by PHP. The result
is a TEXT FILE of some description... yes, even a CSS file.
How to do it depends entirely on your database structure and what you want
to achieve.
But a quick example:
---
<?
$textColour = 'FF9900'; // a var you retrieved from a DB
$bgColour = 'white'; // a var you retrieved from a DB
?>
P { color: #<?=$textColour?>; }
BODY { background-color: #<?=$bgColour?>; }
---
> Will php commands executre from a .css file or is there a different way to
> do this??
.css files will not *automatically* be parsed by PHP, however you can force
them through with either a .htaccess file, or by editing apache's httpd.conf
file to suit.
this is my .htaccess file:
<Files dynamic.css>
ForceType application/x-httpd-php
</Files>
Or, you can just include() some CSS generated by PHP directly into your PHP
application, and it will just appear as part of the HTML source.
Justin French
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php