xampp - I'm trying to make a dynamic CSS (using php header) but I have problems in client -
i renamed stylesheet full.css.php
, on beginning of file wrote code:
<?php header("content-type: text/css; charset: utf-8"); //here want set css variables $font_color = '#ccf'; ?> //here starts css body{ color: <?php echo $font_color?>; }
the browser giving me this: resource interpreted script transferred mime type text/css: "http://localhost/root/_viewer/css/full.css.php".
.
and error: "uncaught syntaxerror: unexpected token {" (this first brace body css declaration).
if in source, find file sent application/javascript
file, not text/css
:
<script type='application/javascript' src='_viewer/css/full.css.php'></script>
i know dynamic css won't cached, it's fine me. it's more important have settings easy access. need fix this.
btw: i'm running under xampp !
-i forgot mention: i'm doing similar 1 of js files , it's working fine ( header("content-type: application/javascript");
)
Comments
Post a Comment