...

View Full Version : style.css.php to just style.css?



tylerh
01-04-2008, 04:07 AM
I was wondering if.. I could change the file extension of style.css.php to just style.css.. The file is this



<?php
header("content-type: text/css");
$style=$_GET['style'];
?>
<?php
if($style=="")
{
?>
File not found.
<?php
}
if($style=="one")
{
?>
body {
margin: 0;
padding: 0;
background: #024855 url(http://envy-layouts.com/style/pinkstripes.gif);
background-position: top left;
background-repeat: repeat;
background-attachment: fixed;
text-align: justify;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #404040;
}
#placement {
margin: 0px auto 0px auto;
width: 811px;
position: relative;
}

<?php
}
end
?>

which results in style.css.php?style=one
wanting style.css?style=one

kbluhm
01-04-2008, 06:51 PM
Create a .htaccess file with the following line, or add the following line to your current .htaccess:

addtype application/x-httpd-php .css

aedrin
01-04-2008, 08:12 PM
It would be more efficient to keep the file as .css.php and add a header() call to tell the browser it is a CSS file.

kbluhm
01-04-2008, 09:54 PM
Obviously.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum