project3 Posted June 9, 2009 Share Posted June 9, 2009 is it possible to make your css pages php extensions then use if thens and use the php file in the css tag? Quote Link to comment https://forums.phpfreaks.com/topic/161523-solved-php-if-then-css/ Share on other sites More sharing options...
MadTechie Posted June 9, 2009 Share Posted June 9, 2009 yes, just make sure you set the header correctly ie <?php header('Content-type: text/css'); //YOU MUST SET THIS AT THE START if($blar) { echo ".style1{width: 100px;}"; }else{ echo ".style1{width: 50px;}"; } ?> .style3{width: 500px;} Quote Link to comment https://forums.phpfreaks.com/topic/161523-solved-php-if-then-css/#findComment-852381 Share on other sites More sharing options...
project3 Posted June 9, 2009 Author Share Posted June 9, 2009 Thanks very much! Quote Link to comment https://forums.phpfreaks.com/topic/161523-solved-php-if-then-css/#findComment-852405 Share on other sites More sharing options...
MadTechie Posted June 9, 2009 Share Posted June 9, 2009 Your very welcome.. Topic Solved? (if so button bottom left) Quote Link to comment https://forums.phpfreaks.com/topic/161523-solved-php-if-then-css/#findComment-852407 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.