Page 2 of 3

Re: Tera-WURFL and Firefox User Agent Switcher!!!

PostPosted: Sat Feb 05, 2011 11:48 am
by kamermans
They are also in that output, they just have HTTP in front of them, this is called the HTTP Request.

Re: Tera-WURFL and Firefox User Agent Switcher!!!

PostPosted: Sat Feb 05, 2011 11:57 am
by rappadappa77
'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'HTTP_ACCEPT_CHARSET' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'HTTP_ACCEPT_ENCODING' => 'gzip,deflate',
'HTTP_ACCEPT_LANGUAGE' => 'en-us,en;q=0.5',
'HTTP_CONNECTION' => 'keep-alive',
'HTTP_COOKIE' => 'SMFCookie463=a%3A4%3A%7Bi%3A0%3Bs%3A1%3A%221%22%3Bi%3A1%3Bs%3A40%3A%228ee8ebfe46fe25c32e27b67aa579f11bbf2a1619%22%3Bi%3A2%3Bi%3A1477870346%3Bi%3A3%3Bi%3A3%3B%7D',
'HTTP_HOST' => 'www.mydomain.com',
'HTTP_KEEP_ALIVE' => '115',
'HTTP_USER_AGENT' => 'BlackBerry8220/4.6.0.308 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/214',

Re: Tera-WURFL and Firefox User Agent Switcher!!!

PostPosted: Sat Feb 05, 2011 12:07 pm
by kamermans
Ah, this is from Firefox, right?

Re: Tera-WURFL and Firefox User Agent Switcher!!!

PostPosted: Sat Feb 05, 2011 12:18 pm
by rappadappa77
Yes it is from Firefox

Re: Tera-WURFL and Firefox User Agent Switcher!!!

PostPosted: Sat Feb 05, 2011 1:07 pm
by kamermans
You can probably use something like this to determine that the request is not mobile:

Code: Select all
if($_SERVER['HTTP_ACCEPT'] == 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' && $_SERVER['HTTP_KEEP_ALIVE'] == '115'){
    // Device is probably not mobile
}

Re: Tera-WURFL and Firefox User Agent Switcher!!!

PostPosted: Sat Feb 05, 2011 1:09 pm
by rappadappa77
Where do i put this code?

Re: Tera-WURFL and Firefox User Agent Switcher!!!

PostPosted: Sat Feb 05, 2011 2:33 pm
by rappadappa77
Hi Kamerman,

I should also indicate that it is for a WML website, created in PHP, meaning i have a normal website for normal browsers mywebsite.com that doesn't have a mobile version, but i have a mobile website mymobile.com (WML) that i want for mobile browsers only, so i should put the code on that index.php file or index-home.wml file?

Re: Tera-WURFL and Firefox User Agent Switcher!!!

PostPosted: Tue Feb 08, 2011 9:18 pm
by kamermans
You would put this code above your other detection code that redirects users between the two sites.

Re: Tera-WURFL and Firefox User Agent Switcher!!!

PostPosted: Wed Feb 09, 2011 1:14 pm
by rappadappa77
Hi Kamermans,

I notice there is another HTTP section when you browse from a real mobile device, maybe it it something that can be used to also help counteract the Firefox User Agent Swithcher.

P.S, i haven't added the Tera-WURFL as yet to my website

Howard

Re: Tera-WURFL and Firefox User Agent Switcher!!!

PostPosted: Wed Feb 09, 2011 3:54 pm
by kamermans
Correct, the existence of a header like "HTTP_X_WAP_PROFILE" would mean the device is most likely mobile, since the User Agent Switcher does not add this. The problem is that not all mobile devices provide this header.