Forum Moderators: coopster

Message Too Old, No Replies

editing CSS with PHP

         

mattbilson

5:22 pm on Jul 7, 2004 (gmt 0)



Hey,

just wondering if anyone can let me know if its possible to create PHP scripts that create a CSS document from a template (maybe hard-coded into the PHP) with various aspects of the CSS being decided by the user.

I've heard its possible to edit and re-save .txt documents to a server, but I don't know whether this would extend to .css files?

Also, is it possible for a PHP script to edit the text in another PHP script?

I'm fairly competent and have a decent amount of experience with PHP so am not afraid of some intense coding! :-)

Thanks in advance,
Matt

timster

6:48 pm on Jul 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



just wondering if anyone can let me know if its possible to create PHP scripts that create a CSS document from a template (maybe hard-coded into the PHP) with various aspects of the CSS being decided by the user.

Certainly possible. You could just create a directory outside your http path, which would contain a subdirectory for each user. Then user a PHP include to make that code part of your HTML or CSS page.

I've heard its possible to edit and re-save .txt documents to a server, but I don't know whether this would extend to .css files?

Sure, css files are text files.

Also, is it possible for a PHP script to edit the text in another PHP script?

What are you trying to accomplish? This sounds like a job for meta-data, to me. Change the behavior of the script without changing the script itself.

coopster

10:23 pm on Jul 7, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, mattbilson!

There was a discussion a while back regarding Server Side Scripting in CSS Files [webmasterworld.com] that may also be of interest to you.