point to actual location of rrdtool
[php-utility-classes.git] / testbed / ua_test.php
index ae7387e76420625924f9eca50c20a525266436af..4bcbd052528be05276d1a0b3f1202608f591161d 100644 (file)
@@ -1,15 +1,9 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-  <link rel="stylesheet" type="text/css" href="testbed.css">
-  <link rel="stylesheet" type="text/css" href="../web/kairo.at/kairo.at.css">
-  <title>KaiRo's Browser-Test</title>
-</head>
-<body>
 <?php
 $inc_class_util = true;
 $inc_class_ua = true;
-include("testhandler.inc");
+include("inchandler.inc");
+
+$wrapper->pgtop("KaiRo's Browser-Test");
 
 $httpvars = $util->getHTTPvars();
 if (strlen($httpvars["ua"])) {
@@ -21,23 +15,31 @@ else {
 
 print("<h1>KaiRo's Browser-Test</h1>\n");
 
-print("I read the following user agent string from your browser:\n<br>");
-print("<b>".$ua->uastring."</b>\n");
+print("I read the following user agent string from ".(strlen($httpvars["ua"])?"your input":"your browser").":\n<br>");
+print("<b>".$ua->getUAString()."</b>\n");
+
+print("<br><br>The browser brand is reported as &quot;<b>".$ua->getBrand()."</b>&quot;\n");
+print("<br>The browser version is reported as &quot;<b>".$ua->getVersion()."</b>&quot;\n");
+print("<br>The browser engine is reported as &quot;<b>".$ua->getEngine()."</b>&quot;\n");
+print("<br>The engine version is reported as &quot;<b>".$ua->getEngineVersion()."</b>&quot;\n");
+print("<br>The operating system is reported as &quot;<b>".$ua->getOS()."</b>&quot;\n");
+print("<br>The system platform is reported as &quot;<b>".$ua->getPlatform()."</b>&quot;\n");
+print("<br>The browser language is reported as &quot;<b>".$ua->getLanguage()."</b>&quot;\n");
+if ($ua->hasEngine('gecko')) {
+  print("<br>The Gecko date is reported as &quot;<b>".$ua->getGeckoDate()."</b>&quot;\n");
+  print("<br>The full Gecko date/time is reported as &quot;<b>".date('r',$ua->getGeckoTime())."</b>&quot;\n");
+}
+print("<br><br>I conclude this must be <b>".$ua->getBrand()." ".$ua->getVersion()."</b>\n");
+print("<br>This is <b>".($ua->isBot()?"an":"no")."</b> automated robot.\n");
 
-print("<br><br>This is <b>".($ua->isns()?"a":"no")."</b> Netscape browser.\n");
-print("<br>This is <b>".($ua->isns4()?"a":"no")."</b> Netscape Communicator 4 browser.\n");
-print("<br>This is <b>".($ua->isie()?"an":"no")."</b> Internet Explorer browser.\n");
-print("<br>This is <b>".($ua->geckobased()?"a":"no")."</b> Gecko-based browser.\n");
-print("<br>This is <b>".($ua->khtmlbased()?"a":"no")."</b> KHTML-based browser.\n");
-print("<br>The browser brand is reported as &quot;<b>".$ua->brand."</b>&quot;\n");
-print("<br>The browser version is reported as &quot;<b>".$ua->version."</b>&quot;\n");
-if ($ua->geckobased()) { print("<br>The Gecko date is reported as &quot;<b>".$ua->geckodate()."</b>&quot;\n"); }
-print("<br><br>I conclude this must be <b>".$ua->brand." ".$ua->version."</b>\n");
+$acclang = $ua->getAcceptLanguages();
+print("<br><br>Accepted Languages: ");
+foreach ($acclang as $lang=>$q) { print($lang."(".$q.") "); }
+print("\n");
 
-print("<br><br>Test the following UA string:\n");
+print("<br><br>Test the following UA string (leave empty to read it from your browser):\n");
 print("<form method=\"POST\" action=\"\"><p>\n");
-print("<input type=\"text\" name=\"ua\" value=\"".$ua->uastring."\" size=\"80\" maxlength=\"150\">\n");
+print("<input type=\"text\" name=\"ua\" value=\"".htmlentities($ua->getUAString())."\" size=\"80\" maxlength=\"150\">\n");
 print("<br><input type=\"submit\" value=\"Test\"></p></form>\n");
+$wrapper->pgbottom();
 ?>
-</body>
-</html>
\ No newline at end of file