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