Re: Browser Detect
| From: | Andy Woolley | Date: | Mon, 04 Dec 2000 13:33:47 +0000 |
| Subject: | Re: Browser Detect | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28569@lists.php.net to get a copy of this message | ||
Sure is.
Heres a function to do just that.
function getbrowser()
{
global $HTTP_USER_AGENT;
if (ereg("MSIE", $HTTP_USER_AGENT) or ereg("Mozilla/5",
$HTTP_USER_AGENT))
{
$browser = "IE";}
else
{
$browser = "NS";}
return $browser;
}
#then some code
if (getbrowser() == "IE")
{
header("location:ie.php");
}
else
{
header("location:netscape.php");
}
It's a bit plain and simple but you get the idea.
Andy
www.databasewatch.com
----- Original Message -----
From: <Website4S@aol.com>
To: <php-general@lists.php.net>
Sent: Monday, December 04, 2000 12:27 PM
Subject: [PHP] Browser Detect
> Hi is it possible to write a browser detect page using PHP and then direct
> the user to a specific location depending on their browser type?
>
> TIA
>
> Ade
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>