PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am experimenting with using PHP to replace bits of data in css files. The idea goes like this. Assign a server base value in a config file. In the css file have php code that echos the server base at the beginning
config.php:
like I would expect. There is one little problem however, all the CRLF have been replaced with LF. This makes Firefox choke on the css. I am looking for a setting or technique to make sure that the result of the PHP parsing my structure.css is CRLF being preserved.
Your results sound strange. It doesn't sound like Firefox, nor PHP. Are you setting the content-type of the resulting css file to be css? PHP's default is to specify HTML.
I hve looked at the css file with a hex editor. I have a local version that works. When compared to the one that actually comes from the server the only difference is the end of lines. I have web developer plug in installed in Firefox. When I choose to edit the css file in web developer the page displays correctly.
Under default configuration, PHP will send a content-type response header signaling the data is HTML. When processing other files, PHP needs to send the proper content-type for that file.
It is important to not output anything before the header command or it will bomb so the header needs to be at the top without any spaces or other code.