Author Topic: redirect script  (Read 14375 times)

0 Members and 1 Guest are viewing this topic.

Offline Cutty Sark Sailor

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3394
    • Frankfort Weather - TwinHollies WeatherCenter
Re: redirect script
« Reply #100 on: April 04, 2011, 12:24:23 PM »
I haven't got my 'mobile' stuff goin, yet... but my original home page was html,
and I decided to go with 'tera-wurfl'
http://www.tera-wurfl.com/wiki/index.php/Installation
The code goes before the doc declaration:
Code: [Select]
<?php
require_once 'WHATEVER DIRECTORY /Tera-WURFL/TeraWurfl.php';
$wurflObj = new TeraWurfl();
$wurflObj->getDeviceCapabilitiesFromAgent();
 
// see if this client is on a wireless device
if($wurflObj->getDeviceCapability("is_wireless_device")){
header("Location: http://ourspecial.net/m/");
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Tera-Wurfl has database that sets
page characteristics for the particular mobile device...http://ourspecial.net/m/
Try this with either your browser, or mobile device:
http://ourspecial.net/Tera-WURFL/test_usage.php
that's the data it will scrub and send, depending on the device that's accessing.
  (Note, my db needs updating, if you don't see what you expect)
Mine's still experimenta, got busy rebuilding my weathersite  :lol:
 


 

anything