Re: Browser detection script (css)
| From: | \[cz\]Emo | Date: | Wed, 04 Jun 2003 20:37:06 +0000 |
| Subject: | Re: Browser detection script (css) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-150264@lists.php.net to get a copy of this message | ||
I don't know if you mean this ...
I use for detect browser and send css for it this script:
<?php
// set default css file (MSIE)
$css='main.css';
// if browser is opera ...
if (substr_count($_SERVER["HTTP_USER_AGENT"], 'Opera'))
{
// ... set opera css
$css='main.opera.css';
}
// if browser is gecko-based (mozilla, etc...)
elseif (substr_count($_SERVER["HTTP_USER_AGENT"], 'Gecko'))
{
// ... set gecko css
$css='main.gecko.css';
}
?>
<html>
<head>
<title> Some title </title>
<link rel=StyleSheet href="<? echo $css; ?>" type="text/css">
<meta http-equiv="content-type" content="text/html;
charset=windows-1250">
</head>
<body>
.....
.....
.....
"ØYstein HåLand" <ha@ematte.se> pí¹e v diskusním pøíspìvku
news:20030604191122.15142.qmail@pb1.pair.com...
> Till now I've bin using the BrowserDetect.class.php by Harry Fuecks. Since
I
> migrated to register_globals=off this produses a lot of error messages.
Has
> anyone a modification that work or another script doing the same?
>
>