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? 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;} 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! 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) 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
Archived
This topic is now archived and is closed to further replies.