Note that there are some explanatory texts on larger screens.

plurals
  1. POCombining CSS and JAVASCRIPT via intelligent automated php script
    primarykey
    data
    text
    <p>found a nice program in <a href="http://www.catswhocode.com/blog/3-ways-to-compress-css-files-using-php" rel="nofollow">this</a> discusson that combines CSS files into one, to speed up and fasten the CSS load. It works and makes all my css files into one tiny heap, <strong>BUT the page shows as text (the webpage becomes a css file, apache thinks) what can be wrong?</strong></p> <p>What i did: I saves the below script as a php file and included that into my page, and changed the urls to the css files with theirs. The css loads fine, but the WEBPAGE shows up as plain text into the browser! while all css is there and the rest of the php generated items too, only thing is the browser things it should load is as plain text, instead of html website... Any clues?</p> <pre><code>&lt;?php header('Content-type: text/css'); ob_start("compress"); function compress($buffer) { /* remove comments */ $buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer); /* remove tabs, spaces, newlines, etc. */ $buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer); return $buffer; } /* your css files */ include('master.css'); include('typography.css'); include('grid.css'); include('print.css'); include('handheld.css'); ob_end_flush(); ?&gt; </code></pre> <p>Furthermore improvements could be made later to even improve its strength, once working:</p> <p><code>"; }"</code> > <code>"}"</code> (2 chars)<br> <code>"{ "</code> > <code>"{"</code> (1 char)<br> <code>" {"</code> > <code>"{"</code> (1char)<br> <code>" :"</code> > <code>":"</code> (1 char)<br> <code>": "</code> > <code>":"</code> (1 char) <code>" ,"</code> > <code>","</code> (1 char)<br> <code>", "</code> > <code>","</code> (1 char) <code>" ("</code> > <code>"("</code> (1 char)<br> <code>"( "</code> > <code>"("</code> (1 char) <code>" )"</code> > <code>")"</code> (1 char)<br> <code>") "</code> > <code>")"</code> (1 char)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload