For those of you interested in putting up WAP or PDA pages on your site, you might find this code handy.
Its a PHP script that checks the user agent of the browser visiting the site and forwards them on to a specific page depending on wheather or not they are using a Wap enabled phone.
its a little dated so it hasnt got every type of user agent in there, but it covers the most popular types.
<?php$status= "HTML" ; $ext= substr($REQUEST_URI,-3,3); $agent= strtolower(trim($HTTP_USER_AGENT)); $browser= substr($agent,0,4); $tviwer= substr(stristr($agent , tv),0,2); $wapviwer= substr(stristr($agent , wap),0,3); if( $ext== "wml" || $wapviwer== "wap" || $browser== "noki" || $browser== "eric" || $browser== "r380" || $browser== "up.b" || $browser== "winw" || $browser== "wapa") ##For redirect WAP users to "yourWAPfile.wml" ##Replace ("/") to ("/hsphere/local/home/site/"). {$status= "WAP" ; header("Content-type: text/vnd.wap.wml"); include "/hsphere/local/home/site/default.wml";} else if( $tviwer== "tv") ##For redirect WEB TV users to "yourWEBTVfile.htm"##Replace ($status= "TV") to (include "yourWEBTVfile.htm").{$status= "TV" ;} else ##For redirect HTML users to "yourHTMLfile.htm" ##Replace ($status= "HTML") to (include "yourHTMLfile.htm"). {$status= "HTML" ;} ?>
From
http://www.aaitechnologies.co.uk/phpexamples.php?