Page 3 of 5

Re: Tables Doesnt Exist

PostPosted: Mon May 10, 2010 6:59 pm
by kamermans
Hooray! I'm glad the mystery is finally solved!

Re: Tables Doesnt Exist

PostPosted: Mon May 10, 2010 7:19 pm
by Carrilero21
Now that I have the database and all working like it should. How do I get it to use it?
I mean, how do I make that in my website when they type: "www.myDomain.com" it first checks what kind of devices it is and redirect to "mobile.MyDomain.com" or stays in "www.myDomain.com"??
Is there a guide for this? Should I post this question in the "Using Tera-WURFL" Forum??

Re: Tables Doesnt Exist

PostPosted: Mon May 10, 2010 7:26 pm
by kamermans
Here's an example from the homepage (http://www.tera-wurfl.com) that does exactly what you want:
Code: Select all
<?php
require_once('./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://mobile.MyDomain.com/");
}
?>

Just put that at the top of your homepage and it will redirect your mobile visitors to your mobile site. Make sure you adjust './TeraWurfl.php' so it matches the location of your TeraWurfl.php file and the mobile.MyDomain.com so that it reflects your mobile site.

Re: Tables Doesnt Exist

PostPosted: Mon May 10, 2010 9:58 pm
by Carrilero21
I am having trouble with the location I think, cause when I go to www.MyDomain.com The first thing in the site is this text:
getDeviceCapabilitiesFromAgent();

Code: Select all
// see if this client is on a wireless device
if($wurflObj->getDeviceCapability("is_wireless_device")){
   header("Location: http://mobile.MyDomain.com/");
}
?>


and then the site normally.

If I have the location like this in the FTP: "/public_html/Tera-Wurfl/TeraWurfl.php"

How should I put this in the code??

The homepage is in: "/public_html/"

Re: Tables Doesnt Exist

PostPosted: Tue May 11, 2010 7:13 am
by kamermans
The code that I posted needs to go in the PHP file for your website's homepage. I'm assuming this page is PHP, normally it's called index.php. You would need to edit that file and put the code at the top.

Re: Tables Doesnt Exist

PostPosted: Tue May 11, 2010 2:53 pm
by Carrilero21
Oh no, its an .html called "index.html"

Re: Tables Doesnt Exist

PostPosted: Tue May 11, 2010 3:04 pm
by kamermans
Ok, then rename it to index.php and put the code exactly at the top of the page - before all other content. There can be nothing before it. Here's the code with your path in it:
Code: Select all
<?php
require_once('./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://mobile.MyDomain.com/");
}
?>

Re: Tables Doesnt Exist

PostPosted: Tue May 11, 2010 3:20 pm
by Carrilero21
WOW! I didn't know that by just renaming it would work!

Thanks a lot! my website is up and running great thanks to your support and time!


THANKS A LOT!! All the problems I had are solved! :D

Re: Tables Doesnt Exist

PostPosted: Tue May 11, 2010 3:23 pm
by kamermans
No problem!

Re: Tables Doesnt Exist

PostPosted: Wed May 12, 2010 12:34 pm
by Carrilero21
Ohh yes, maybe one last question. I was reading back on the posts and remembered you telling me about an .htaccess file.

I now know what they are, and why they are useful but I don't know how to create one and what to put on it.
Do you still recommend I use one in the admin directory?