Re[4]: [PHP] Re: Detecting devices i.e. PDA, Mobile

From: Date: Wed, 15 Oct 2003 16:40:38 +0000
Subject: Re[4]: [PHP] Re: Detecting devices i.e. PDA, Mobile
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-166226@lists.php.net to get a copy of this message
Hi, Thursday, October 16, 2003, 1:28:23 AM, you wrote: S> Justin, S> Thank you for you replies, I have decided to convert the whole site to S> XHTML, for compatability. However, I am unable to view the site through my S> phones WAP browser, does this mean XHTML is only compatible with PC's and S> PDA's? I have validadted the code at S> http://validator.w3.org ... S> Thanks for your help wap uses xml with a very strict dtd which bears no resemblance to xhtml so you are heading to a point where you will need to re-ask your original question of how to detect a wap request and serve up the correct type of content. Your best approach is to make a simple wap page and before serving it, email yourself the output of the various enviroment variables that are present. Something like this: (test.php) <?php //this must be the first line or headers won't work ob_start(); phpinfo(32); $headers = apache_request_headers(); print_r($headers); $buffer = ob_get_contents(); ob_end_clean(); mail('me@mydomain.com','Test Result',$buffer); $test = "hello"; header("Content-type: text/vnd.wap.wml"); echo '<?xml version="1.0">'; ?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <card> <p> Welcome to<br/>my test page. </p> <p> <?echo $test?> </p> </card> </wml> then hit test.php with your phone and see what turns up -- regards, Tom

« previous php.general (#166226) next »