b8db1df4 |
1 | <?php |
2 | $inc_class_util = true; |
3 | $inc_class_ua = true; |
32412c2a |
4 | include("inchandler.inc"); |
b8db1df4 |
5 | |
1c666195 |
6 | $wrapper->pgtop("KaiRo's Browser-Test"); |
7 | |
b8db1df4 |
8 | $httpvars = $util->getHTTPvars(); |
9 | if (strlen($httpvars["ua"])) { |
10 | $ua = new userAgent($httpvars["ua"]); |
11 | } |
12 | else { |
13 | $ua = new userAgent; |
14 | } |
15 | |
16 | print("<h1>KaiRo's Browser-Test</h1>\n"); |
17 | |
1c666195 |
18 | print("I read the following user agent string from ".(strlen($httpvars["ua"])?"your input":"your browser").":\n<br>"); |
b8db1df4 |
19 | print("<b>".$ua->uastring."</b>\n"); |
20 | |
21 | print("<br><br>This is <b>".($ua->isns()?"a":"no")."</b> Netscape browser.\n"); |
22 | print("<br>This is <b>".($ua->isns4()?"a":"no")."</b> Netscape Communicator 4 browser.\n"); |
23 | print("<br>This is <b>".($ua->isie()?"an":"no")."</b> Internet Explorer browser.\n"); |
24 | print("<br>This is <b>".($ua->geckobased()?"a":"no")."</b> Gecko-based browser.\n"); |
25 | print("<br>This is <b>".($ua->khtmlbased()?"a":"no")."</b> KHTML-based browser.\n"); |
726d345a |
26 | print("<br>The browser brand is reported as "<b>".$ua->getBrand()."</b>"\n"); |
27 | print("<br>The browser version is reported as "<b>".$ua->getVersion()."</b>"\n"); |
b8db1df4 |
28 | if ($ua->geckobased()) { print("<br>The Gecko date is reported as "<b>".$ua->geckodate()."</b>"\n"); } |
726d345a |
29 | print("<br><br>I conclude this must be <b>".$ua->getBrand()." ".$ua->getVersion()."</b>\n"); |
b8db1df4 |
30 | |
1c666195 |
31 | print("<br><br>Test the following UA string (leave empty to read it from your browser):\n"); |
b8db1df4 |
32 | print("<form method=\"POST\" action=\"\"><p>\n"); |
33 | print("<input type=\"text\" name=\"ua\" value=\"".$ua->uastring."\" size=\"80\" maxlength=\"150\">\n"); |
34 | print("<br><input type=\"submit\" value=\"Test\"></p></form>\n"); |
1c666195 |
35 | |
36 | $wrapper->pgbottom(); |
b8db1df4 |
37 | ?> |