tomdelonge Posted September 6, 2008 Share Posted September 6, 2008 would i be able to do that? up until now, i've just been including "stylesheet.php", but i'd much rather link the css file (so that the user can't see the file). would the server be able to parse it? or is that something i do with .htaccess and apache? Quote Link to comment https://forums.phpfreaks.com/topic/123032-parsing-css-files/ Share on other sites More sharing options...
wildteen88 Posted September 6, 2008 Share Posted September 6, 2008 Use the HTML <link /> tag, eg <link rel="stylesheet" type="text/css" href="stylesheet.css"> Quote Link to comment https://forums.phpfreaks.com/topic/123032-parsing-css-files/#findComment-635279 Share on other sites More sharing options...
tomdelonge Posted September 6, 2008 Author Share Posted September 6, 2008 no, i know that. i want to be able to parse the css file, so if it says something like "font-size: <?php echo $myfontsize; ?>" in it, then the server parses the css file and it works correctly. Quote Link to comment https://forums.phpfreaks.com/topic/123032-parsing-css-files/#findComment-635289 Share on other sites More sharing options...
BlueSkyIS Posted September 6, 2008 Share Posted September 6, 2008 i never tried this with css, but in .htaccess: AddType application/x-httpd-php .css Quote Link to comment https://forums.phpfreaks.com/topic/123032-parsing-css-files/#findComment-635292 Share on other sites More sharing options...
wildteen88 Posted September 6, 2008 Share Posted September 6, 2008 i never tried this with css, but in .htaccess: AddType application/x-httpd-php .css No need for that. Just do <?php header('Content-Type: text/css'); ?> /* your styles here */ Then do <link rel="stylesheet" type="text/css" href="stylesheet.php"> stylesheet.php will be parsed by PHP, which will return the CSS for your browser. Quote Link to comment https://forums.phpfreaks.com/topic/123032-parsing-css-files/#findComment-635331 Share on other sites More sharing options...
BlueSkyIS Posted September 6, 2008 Share Posted September 6, 2008 good idea. good one to know. thanks! Quote Link to comment https://forums.phpfreaks.com/topic/123032-parsing-css-files/#findComment-635350 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.