Page 1 of 1

error on page

PostPosted: Tue Mar 01, 2011 2:10 pm
by IMSM
For some reason in the last few days my page
Code: Select all
http://www.mobideviceads.com/pbma.html
has been throwing an error:


I'm using this script:
Code: Select all
<?php

require_once("Tera-Wurfl/TeraWurfl.php");
$wurflObj = new TeraWurfl();
$wurflObj->getDeviceCapabilitiesFromAgent();
$isWireless = $wurflObj->getDeviceCapability("is_wireless_device");

if($isWireless)
   header("location: http://www.m.mobideviceads.com/pbma.html");

?>

<html>
<head>



AND IT'S THROWING ERRORS!
What to do?
Thanks,
MDA

Re: error on page

PostPosted: Tue Mar 01, 2011 2:28 pm
by kamermans
Hi MDA, the problem is that you put this script in a .html file, which is not being parsed by PHP. The file needs to have the extension .php to work properly, or you will need to do use another method to tell Apache that you want html files parsed as if they were php.

Re: error on page

PostPosted: Tue Mar 01, 2011 4:26 pm
by IMSM
Okay that makes sense. However, does that mean that if I want the tera-wurfl php script to reside at the top of all my pages that I have to have the .com site pages end with .php?

Re: error on page

PostPosted: Tue Mar 01, 2011 10:23 pm
by kamermans
Yes it does.