Exemplo n.º 1
0
	$data = $hd->getReply();
	print_r($data);
} else {
	print $hd->getError();
}
echo "</p>";
*/
// ***************************** Detection Examples ********************************
// This is the most simple detection call - http headers are picked up automatically.
// You're probably using a normal browser so expect this to reply with NOTFOUND
echo "<h1>Simple Detection - Using your web browser standard headers (expect NotFound)</h1><p>";
if ($hd->siteDetect()) {
    $tmp = $hd->getReply();
    print_r($tmp);
} else {
    print $hd->getError();
}
echo "</p>";
// This manually sets the headers that a Nokia N95 would set.
// Other agents you also might like to try
// Mozilla/5.0 (BlackBerry; U; BlackBerry 9300; es) AppleWebKit/534.8+ (KHTML, like Gecko) Version/6.0.0.534 Mobile Safari/534.8+
// Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95-3/20.2.011 Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413
// Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5
echo "<h1>Simple Detection - Setting Headers for an N95</h1><p>";
$hd->setDetectVar('user-agent', 'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95-3/20.2.011 Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413');
$hd->setDetectVar('x-wap-profile', 'http://nds1.nds.nokia.com/uaprof/NN95-1r100.xml');
if ($hd->siteDetect()) {
    $tmp = $hd->getReply();
    print_r($tmp);
} else {
    print $hd->getError();