Need some help with my script
Posted: Tue Mar 19, 2013 3:00 pm
For the website of my single-man-company I use Wurfl to redirect mobile users to a mobile version of my website.
This is the script I put in the pages to redirect:
require_once("wurfl/TeraWurfl.php");
$wurflObj = new TeraWurfl();
$wurflObj->getDeviceCapabilitiesFromAgent();
$isWireless = $wurflObj->getDeviceCapability("is_wireless_device");
if($isWireless)
header("location: http://www.m.klussenpunt.nl/index.html");
As an amateur programmer I'm happy the way this works for several years and that I figured this out.
My main website is 1000 pixels width and the mobile website is 300 pixels width.
At this moment all the tablets wil be redirected to the mobile website, and that is unnecessary, a bit annoying even.
The question: could anyone help me provide some script I can use redirecting only the devices with a width smaller than 800 pixels (landscape)?
This is the script I put in the pages to redirect:
require_once("wurfl/TeraWurfl.php");
$wurflObj = new TeraWurfl();
$wurflObj->getDeviceCapabilitiesFromAgent();
$isWireless = $wurflObj->getDeviceCapability("is_wireless_device");
if($isWireless)
header("location: http://www.m.klussenpunt.nl/index.html");
As an amateur programmer I'm happy the way this works for several years and that I figured this out.
My main website is 1000 pixels width and the mobile website is 300 pixels width.
At this moment all the tablets wil be redirected to the mobile website, and that is unnecessary, a bit annoying even.
The question: could anyone help me provide some script I can use redirecting only the devices with a width smaller than 800 pixels (landscape)?