Genie 7110 Garage Door Opener User Manual


 
February 2001 Genie Application Style Guide 73
A
Appendix A Identifying the Browser
Several classes of web clients could potentially access your site, but for the sake of
simplicity, this appendix addresses four possible situations:
1 A client that expects HTML
2 A Nokia 7110 browser
3 A device with the UP.Browser v3.1 or 4.x that supports WML 1.1
4 A Mitsubishi Trium browser
To identify which client is accessing your site, investigate two different HTTP headers,
HTTP_ACCEPT and HTTP_USER_AGENT. While neither of these is part of the WAP
specifications, they are both standard HTTP headers defined in RFC1945 (see
http://www.rfc-editor.org/rfcsearch.html).
The first step is to look the
HTTP_ACCEPT header and parse it for the inclusion of
text/vnd.wap.wml:
Perl
#!/usr/local/bin/perl
$acc = $ENV{"HTTP_ACCEPT"};
$ua = $ENV{"HTTP_USER_AGENT"};
if ($acc =~ "wml"){
deliver wml
}
else{
print' Location: http://mysite.com/index.html'."\n\n";
}