Jump to content

Edit CSS file in PHP


Bman900

Recommended Posts

yeahhhhh. . . youre right ken, i keep answering too quickly and giving stupid answers, sorry bman.

 

you can definitely include multiple style sheets, and use php to switch the sheet whenever you want, but that might not be exactly what you're asking.

 

kens answer is clever, then use stristr or strstr substr and str_replace to do what you need to do, and fwrite over the file

Link to comment
https://forums.phpfreaks.com/topic/156727-edit-css-file-in-php/#findComment-825293
Share on other sites

Well I want to make it simple for the user. Basically this is what I want to do:

 

.css file

 

#header {

  color:          #003399;

  background:      #8CA8E6;

}

 

And then my admin panel would have:

 

Backround: ___________ SUBMIT

 

Can this be done in .css?

 

<?php $backround = "#8CA8E6"; ?>

 

#header {

  color:          #003399;

  background:      <?php echo"$backround"; ?>;

}

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/156727-edit-css-file-in-php/#findComment-825296
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.