Commit | Line | Data |
---|---|---|
b8db1df4 | 1 | <?php |
2 | $inc_class_util = true; | |
3 | $inc_class_ua = true; | |
32412c2a | 4 | include("inchandler.inc"); |
b8db1df4 | 5 | |
1c666195 | 6 | $wrapper->pgtop("KaiRo's Browser-Test"); |
7 | ||
b8db1df4 | 8 | $httpvars = $util->getHTTPvars(); |
9 | if (strlen($httpvars["ua"])) { | |
10 | $ua = new userAgent($httpvars["ua"]); | |
11 | } | |
12 | else { | |
13 | $ua = new userAgent; | |
14 | } | |
15 | ||
16 | print("<h1>KaiRo's Browser-Test</h1>\n"); | |
17 | ||
1c666195 | 18 | print("I read the following user agent string from ".(strlen($httpvars["ua"])?"your input":"your browser").":\n<br>"); |
e742e507 | 19 | print("<b>".$ua->getUAString()."</b>\n"); |
b8db1df4 | 20 | |
e742e507 | 21 | print("<br><br>The browser brand is reported as "<b>".$ua->getBrand()."</b>"\n"); |
726d345a | 22 | print("<br>The browser version is reported as "<b>".$ua->getVersion()."</b>"\n"); |
e742e507 | 23 | print("<br>The browser engine is reported as "<b>".$ua->getEngine()."</b>"\n"); |
24 | print("<br>The engine version is reported as "<b>".$ua->getEngineVersion()."</b>"\n"); | |
25 | print("<br>The operating system is reported as "<b>".$ua->getOS()."</b>"\n"); | |
26 | print("<br>The system platform is reported as "<b>".$ua->getPlatform()."</b>"\n"); | |
27 | print("<br>The browser language is reported as "<b>".$ua->getLanguage()."</b>"\n"); | |
a3e499ad RK |
28 | if ($ua->hasEngine('gecko')) { |
29 | print("<br>The Gecko date is reported as "<b>".$ua->getGeckoDate()."</b>"\n"); | |
30 | print("<br>The full Gecko date/time is reported as "<b>".date('r',$ua->getGeckoTime())."</b>"\n"); | |
31 | } | |
726d345a | 32 | print("<br><br>I conclude this must be <b>".$ua->getBrand()." ".$ua->getVersion()."</b>\n"); |
e742e507 | 33 | print("<br>This is <b>".($ua->isBot()?"an":"no")."</b> automated robot.\n"); |
34 | ||
35 | $acclang = $ua->getAcceptLanguages(); | |
36 | print("<br><br>Accepted Languages: "); | |
37 | foreach ($acclang as $lang=>$q) { print($lang."(".$q.") "); } | |
38 | print("\n"); | |
b8db1df4 | 39 | |
1c666195 | 40 | print("<br><br>Test the following UA string (leave empty to read it from your browser):\n"); |
b8db1df4 | 41 | print("<form method=\"POST\" action=\"\"><p>\n"); |
4a778b7e | 42 | print("<input type=\"text\" name=\"ua\" value=\"".htmlentities($ua->getUAString())."\" size=\"80\" maxlength=\"150\">\n"); |
b8db1df4 | 43 | print("<br><input type=\"submit\" value=\"Test\"></p></form>\n"); |
1c666195 | 44 | $wrapper->pgbottom(); |
b8db1df4 | 45 | ?> |