php - dynamic css file won't load on web, works on xampp -


this first question , try job.

i use dss file website in development want "display:none" divs if conditions met (user logged in -> no need register-form)

so index.php head-tag linking stylesheet looks follows:

   <link rel="stylesheet" href="css/default.php" type="text/css"> 

the default.php css file has following start:

    <?php      session_start();     header('content-type: text/css');?> 

on local webserver (xampp on os x) works fine. on online server css isn't applied. can visit broken website here:

hsturnierv2.pixelpioniere.net

it links correct file, style not applied.

edit:

never underestimate power of linebreak. php-tag in css file did not start @ line 1. thank you!

check mime type server returning css with. https://developer.mozilla.org/en-us/docs/incorrect_mime_type_for_css_files

note: though wil work way want, should double-check if reduction in css file size makes impossibility cache css client-side.

apart that, actual problem try modify header information when header has been sent. puts error message output on top of css, invalidating it.

<br /> <b>warning</b>:  session_start(): cannot send session cache limiter - headers sent (output started @ /www/htdocs/w011c30e/hst/public_html/css/default.php:2) in <b>/www/htdocs/w011c30e/hst/public_html/css/default.php</b> on line <b>3</b><br /> <br /> <b>warning</b>:  cannot modify header information - headers sent (output started @ /www/htdocs/w011c30e/hst/public_html/css/default.php:2) in <b>/www/htdocs/w011c30e/hst/public_html/css/default.php</b> on line <b>4</b><br /> 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -