ante1820
ante1820

Reputation: 112

PHP app browser limit

I was found many class for detecting browser but I have problem with some of that, does anybody have easy source for this easy problem:

I want limit user who want work in one application only for Chrome and FF, I will make demo:

if($browser == 'Chrome' OR $browser == 'FF')
{
echo 'All ok';
}else
{
echo 'Not ok, I calling my internal redirection function and redirect user to applimit.php';
}

Upvotes: 0

Views: 110

Answers (1)

Arturs
Arturs

Reputation: 1258

Use this, to know browser.

echo $_SERVER['HTTP_USER_AGENT'] . "\n\n";

$browser = get_browser(null, true);
print_r($browser);

Reference php.net

Upvotes: 1

Related Questions