Link to home
Start Free TrialLog in
Avatar of DEGtheLEG
DEGtheLEG

asked on

Detect if site visitor is using cellular data

Hi, we are running a private medium sized file hosting site (in php) which offers differing features depending on device (Desktop, Mobile device etc..).

Currently the device is detected by querying $_SERVER['HTTP_USER_AGENT'] However this does not seem to hold any clues as to a data service the vistor is using. Our client is requesting restrictions be made depending if the user is using their device on a wifi connection or on a mobile data connection.

Is their any known way to detect (by either php, js or htaccess) if a visitor on a mobile device is on a wifi network of on a cellular data network.

Thanks for any help.

Avatar of DominoG
DominoG
Flag of Ireland image

The only way I can think of to achieve this is by building (or acquiring/purchasing) a database containing  the IP ranges of cellular data providers.

This method won't be perfect by any stretch though as more and more cellular providers are also stretching into fixed line/wireless ISP's.
ASKER CERTIFIED SOLUTION
Avatar of DominoG
DominoG
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes I agree with DominoG I think that to get it perfect is more or less an impossible task. There's definitely nothing in the  $_SERVER array with that sort of info, you would need up-to-date info on all networks. You could do a speed test, but that would be very inaccurate and could result in a Wifi broadband user being sometimes put onto the 3G site. I would not recommend this sort of thing at all.....