WURFL - PHP API (v1.0 2009-03-09) - How To Use "is_wireless_device"

Started on the old forum in June 2009 · view the original in the archive · old links redirect here

#mobile-device-detection #tera #wurfl

8 replies · 1,414 views · started 17 years ago · 1 min read

3 participants
IceBurn Junior · 13 posts #1

Hi!

I remember to post this question here because I know Gum is using WURFL, but if anyone can help...

I've just set up WURFL using the PHP API, however it seems that I cannot find a proper documentation on how to check if UA is a mobile phone or not...

I heard about 'is_wireless_device', but I'm still stuck on it...

I'm using it like this:

$device = $wurflManager->getDeviceForUserAgent($_SERVER['HTTP_USER_AGENT']);		
echo $device->getCapability('is_wireless_device');

But the damn thing always return true, even in Opera desktop version!! What can be wrong? I have the latest wurfl.xml

Or is there any other WURFL function to properly detect if it's a mobile phone or not?

EDIT: I've just test it with firefox, it return FALSE correctly. But what's up with Opera desktop version that return true??

Thanks in advance.

GumSlone Administrator Principal · 1,690 posts #3

IceBurn wrote: Nevermind, I got it working by using PHP Tools version 2.1 Final

if you just want to detect the pc or mpbile and redirect them to different locations you can use the code from: http://detectmobilebrowsers.mobi/

PS. i had some problems with php tools for wurfl at some high traffic sites, so im using there the tera wurfl http://www.tera-wurfl.com/

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

IceBurn Junior · 13 posts #4

Ok, thank you for the tip about detectmobilebrowsers.mobi

Yes, for now I just need to detect mobile phones so I'm going to check that link and put wurfl as plan B.

ifuschini Newbie · 9 posts #6

Hi Ice, I am the owner of Apache Mobile Filter, let me know your opinion.

Thanks Idel

IceBurn Junior · 13 posts #7

Nice job ifuschini!

It used to be an old wurlf apache mod, but it was outdated so yesterday I found yours. I haven't install it yet on my production server, but I will let you know when (and if) I install it.

My main concern is about performance... have you made an option to make it available by htaccess? Like, have it off as default and if I want to turn it on on a specific domain, I can just make an instruction in htaccess?

That would be a must. I'm using mod GEO IP and that's how I do, only activate it in the htaccess for the domains where I need it.

In the meantime I've also found this simple PHP class written by Victor Stanciu, that's able to detect mobile phones, much like the function at detectmobilebrowsers.mobi, but more simple and consequently more fast. Check it out: php-mobile-detect - Google Code

ifuschini Newbie · 9 posts #8

I'm sorry IceBurn, but I haven't made this option, but could be a good idea for new feature.

Idel

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close