php to control the view of css
Hello,
I want to create a php file to check the visitor browser and version and upon it view a certain css
In my pages I have :
Code:
<style type="text/css" media="all">@import "/css/css.php?1";</style>
in the css.php I have :
Code:
<?php if(ereg("\?1$", $REQUEST_URI)) {
if (strstr (getenv('HTTP_USER_AGENT'), 'MSIE')) {
include "/css/ie.css";
}
elseif (strstr (getenv('HTTP_USER_AGENT'), 'Netscape')) {
include "/css/ns.css";
}
elseif (strstr (getenv('HTTP_USER_AGENT'), 'opera')) {
include "/css/opera.css";
}
else {
include "/css/others.css";
}}
?>
I would like it to check the version also can anyone help?
Also is it possible to prevent users from downloading the css if accessed css.php?1 ?