ae7387e76420625924f9eca50c20a525266436af
[php-utility-classes.git] / testbed / ua_test.php
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <head>
4   <link rel="stylesheet" type="text/css" href="testbed.css">
5   <link rel="stylesheet" type="text/css" href="../web/kairo.at/kairo.at.css">
6   <title>KaiRo's Browser-Test</title>
7 </head>
8 <body>
9 <?php
10 $inc_class_util = true;
11 $inc_class_ua = true;
12 include("testhandler.inc");
13
14 $httpvars = $util->getHTTPvars();
15 if (strlen($httpvars["ua"])) {
16   $ua = new userAgent($httpvars["ua"]);
17 }
18 else {
19   $ua = new userAgent;
20 }
21
22 print("<h1>KaiRo's Browser-Test</h1>\n");
23
24 print("I read the following user agent string from your browser:\n<br>");
25 print("<b>".$ua->uastring."</b>\n");
26
27 print("<br><br>This is <b>".($ua->isns()?"a":"no")."</b> Netscape browser.\n");
28 print("<br>This is <b>".($ua->isns4()?"a":"no")."</b> Netscape Communicator 4 browser.\n");
29 print("<br>This is <b>".($ua->isie()?"an":"no")."</b> Internet Explorer browser.\n");
30 print("<br>This is <b>".($ua->geckobased()?"a":"no")."</b> Gecko-based browser.\n");
31 print("<br>This is <b>".($ua->khtmlbased()?"a":"no")."</b> KHTML-based browser.\n");
32 print("<br>The browser brand is reported as &quot;<b>".$ua->brand."</b>&quot;\n");
33 print("<br>The browser version is reported as &quot;<b>".$ua->version."</b>&quot;\n");
34 if ($ua->geckobased()) { print("<br>The Gecko date is reported as &quot;<b>".$ua->geckodate()."</b>&quot;\n"); }
35 print("<br><br>I conclude this must be <b>".$ua->brand." ".$ua->version."</b>\n");
36
37 print("<br><br>Test the following UA string:\n");
38 print("<form method=\"POST\" action=\"\"><p>\n");
39 print("<input type=\"text\" name=\"ua\" value=\"".$ua->uastring."\" size=\"80\" maxlength=\"150\">\n");
40 print("<br><input type=\"submit\" value=\"Test\"></p></form>\n");
41 ?>
42 </body>
43 </html>