Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.