2 $inc_class_util = true;
4 include("inchandler.inc");
6 $wrapper->pgtop("KaiRo's Browser-Test");
8 // set default time zone - right now, always the one the server is in!
9 date_default_timezone_set('Europe/Vienna');
11 $httpvars = $util->getHTTPvars();
12 if (strlen($httpvars["ua"])) {
13 $ua = new userAgent($httpvars["ua"]);
19 print("<h1>KaiRo's Browser-Test</h1>\n");
21 print("I read the following user agent string from ".(strlen($httpvars["ua"])?"your input":"your browser").":\n<br>");
22 print("<b>".$ua->getUAString()."</b>\n");
24 print("<br><br>The browser brand is reported as "<b>".$ua->getBrand()."</b>"\n");
25 print("<br>The browser version is reported as "<b>".$ua->getVersion()."</b>"\n");
26 print("<br>The browser engine is reported as "<b>".$ua->getEngine()."</b>"\n");
27 print("<br>The engine version is reported as "<b>".$ua->getEngineVersion()."</b>"\n");
28 print("<br>The operating system is reported as "<b>".$ua->getOS()."</b>"\n");
29 print("<br>The system platform is reported as "<b>".$ua->getPlatform()."</b>"\n");
30 print("<br>The browser language is reported as "<b>".$ua->getLanguage()."</b>"\n");
31 if ($ua->hasEngine('gecko')) {
32 print("<br>The Gecko date is reported as "<b>".$ua->getGeckoDate()."</b>"\n");
33 print("<br>The full Gecko date/time is reported as "<b>".date('r',$ua->getGeckoTime())."</b>"\n");
35 print("<br><br>I conclude this must be <b>".$ua->getBrand()." ".$ua->getVersion()."</b>\n");
36 print("<br>This is <b>".($ua->isBot()?"an":"no")."</b> automated robot.\n");
38 $acclang = $ua->getAcceptLanguages();
39 print("<br><br>Accepted Languages: ");
40 foreach ($acclang as $lang=>$q) { print($lang."(".$q.") "); }
43 print("<br><br>Test the following UA string (leave empty to read it from your browser):\n");
44 print("<form method=\"POST\" action=\"\"><p>\n");
45 print("<input type=\"text\" name=\"ua\" value=\"".htmlentities($ua->getUAString())."\" size=\"80\" maxlength=\"150\">\n");
46 print("<br><input type=\"submit\" value=\"Test\"></p></form>\n");