adding wahl-mandatsberechnung, ua test
[php-utility-classes.git] / testbed / ua_test.php
... / ...
CommitLineData
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;
12include("testhandler.inc");
13
14$httpvars = $util->getHTTPvars();
15if (strlen($httpvars["ua"])) {
16 $ua = new userAgent($httpvars["ua"]);
17}
18else {
19 $ua = new userAgent;
20}
21
22print("<h1>KaiRo's Browser-Test</h1>\n");
23
24print("I read the following user agent string from your browser:\n<br>");
25print("<b>".$ua->uastring."</b>\n");
26
27print("<br><br>This is <b>".($ua->isns()?"a":"no")."</b> Netscape browser.\n");
28print("<br>This is <b>".($ua->isns4()?"a":"no")."</b> Netscape Communicator 4 browser.\n");
29print("<br>This is <b>".($ua->isie()?"an":"no")."</b> Internet Explorer browser.\n");
30print("<br>This is <b>".($ua->geckobased()?"a":"no")."</b> Gecko-based browser.\n");
31print("<br>This is <b>".($ua->khtmlbased()?"a":"no")."</b> KHTML-based browser.\n");
32print("<br>The browser brand is reported as &quot;<b>".$ua->brand."</b>&quot;\n");
33print("<br>The browser version is reported as &quot;<b>".$ua->version."</b>&quot;\n");
34if ($ua->geckobased()) { print("<br>The Gecko date is reported as &quot;<b>".$ua->geckodate()."</b>&quot;\n"); }
35print("<br><br>I conclude this must be <b>".$ua->brand." ".$ua->version."</b>\n");
36
37print("<br><br>Test the following UA string:\n");
38print("<form method=\"POST\" action=\"\"><p>\n");
39print("<input type=\"text\" name=\"ua\" value=\"".$ua->uastring."\" size=\"80\" maxlength=\"150\">\n");
40print("<br><input type=\"submit\" value=\"Test\"></p></form>\n");
41?>
42</body>
43</html>