Jump to content

php is stylesheets?


Maknib

Recommended Posts

You can either configure your server to parse .css files as php code (you need to be careful not to let users/hackers upload .css files that contain their php code) or you can use a .php file as the external css file and output a Content-type: text/css header at the start of the php code in the file.

Link to comment
https://forums.phpfreaks.com/topic/245556-php-is-stylesheets/#findComment-1261196
Share on other sites

you cant include php code in a css file. You could use the php in a html document and create inline styling:

 

<style type="text/css">
body
{
background-color: <?php echo $color; ?>;
}
</style>

 

thanks, i was thinking of that but i thought inline was frowned upon a bit.

Link to comment
https://forums.phpfreaks.com/topic/245556-php-is-stylesheets/#findComment-1261197
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.