---
title: "Browser check"
type: "forum-thread"
url: "https://www.webforum.nu/amne/php/15373-browser-check"
topic: "PHP"
topic_url: "https://www.webforum.nu/amne/php"
author: "Alpha II"
published: "2001-03-15T18:38:00.000Z"
updated: "2001-03-15T20:18:00.000Z"
replies: 3
views: 314
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/php/15373-browser-check"
---

# Browser check

## #1 — Alpha II, 2001-03-15T18:38Z

Hur kollar man vilken webbläsare besökaren har? :)

Permalänk: https://www.webforum.nu/p/15373

## #2 — Kim, 2001-03-15T19:06Z

Kolla in <http://se.php.net/manual/en/function.get-browser.php>

Permalänk: https://www.webforum.nu/p/317667

## #3 — Alpha II, 2001-03-15T19:42Z

Det funkar inte :(

Går det inte att göra nåt liknande det här:

if ($browser="ie")
 echo "Internet Explorer";
if ($browser="ns")
 echo "Netscape";

Permalänk: https://www.webforum.nu/p/317668

## #4 — Frofro, 2001-03-15T20:18Z

Ett litet exempel

```
<?php
if(strstr($HTTP_USER_AGENT, "MSIE 5")) {
  header("Location: ie5.html");
} else if(strstr($HTTP_USER_AGENT, "MSIE 4")) {
  header("Location: ie4.html");
} else if(strstr($HTTP_USER_AGENT, "Mozilla/4")) {
  header("Location: ns4.html");
} else {
  header("Location: sorry.html");
}
?>
```

/Staffan

Permalänk: https://www.webforum.nu/p/317669

---

Tråden på webben: https://www.webforum.nu/amne/php/15373-browser-check
