how do you detect if a browser is a WAP browser?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
twrofpwr
Forum Newbie
Posts: 17
Joined: Wed Jun 15, 2005 8:46 pm

how do you detect if a browser is a WAP browser?

Post by twrofpwr »

Hey guys how do you detect if someone is coming from a WAP enabled device?

:)
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

The only way I know how to is by checking $_SERVER[HTTP_USER_AGENT] and running that against a table...

Code: Select all

$_SERVER[HTTP_USER_AGENT] => BlackBerry7520/4.0.0 UP.Browser/5.0.3.3 UP.Link/5.1.2.12 (Google WAP Proxy/1.0)

Code: Select all

Alcatel-TH3/1.0 UP.Browser/6.2.ALCATEL MMP/1.0
AU-MIC/2.0 MMP/2.0
BlackBerry7100/3.8.0
BlackBerry7230/3.7.1 UP.Link/1.1
BlackBerry7230/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1
BlackBerry7250/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1
BlackBerry7520/4.0.0 UP.Browser/5.0.3.3 UP.Link/5.1.2.12 (Google WAP Proxy/1.0)
BlackBerry7730/3.7.1
BlackBerry7750/3.7.1
BlackBerry7780/3.7.1
jBrowser-WAP/1.0.4
miladmovie
Forum Newbie
Posts: 2
Joined: Wed Oct 19, 2005 6:15 pm
Location: Iran - Bushehr
Contact:

Post by miladmovie »

hello
I have same problem
see this browser : http://www.wapsilon.com/?t=w;f=1::wapsilon.com
if you enter google.com it will redirec to google wap !
but really how can detect ?
as you see this is not have $_SERVER[HTTP_USER_AGENT] like you wrote!?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Code: Select all

$_SERVER['HTTP_USER_AGENT']
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

In theory a WAP browser should have text/wml rather than text/html in it's HTTP_ACCEPT string..
Post Reply