How To Detect Mobile Browsers Wireless Cellphone Users Visiting Your Site

Forums » Tutorial And Guides » How To Detect Mobile Browsers Wireless Cellphone Users Visiting Your Site
This Page Contains information about How To Detect Mobile Browsers Wireless Cellphone Users Visiting Your Site By wallpaperama in category Tutorial And Guides with 8 Replies. Last Upated: Thu May 15, 2014
now a days you can put wallpapers anywhere, its not just for desktops anymore
its for laptops, pda's, cellphones, smart phones etc..

so there will come a time when you will have to provide content for wurl users

so just how can you detect if a user is using a cell phone when they visit your site.

there are a number of way, the easiest i know how is to do it server side

with php you can do that

php is very powerful programming language that lets you do alot of things for your website

so often i used this function or class to detect if a user visiting my site is coming from a mobile device or not


function checkmobile(){

if(isset($_SERVER["HTTP_X_WAP_PROFILE"])) return true;

if(preg_match("/wap.|.wap/i",$_SERVER["HTTP_ACCEPT"])) return true;


$uamatches = array("midp", "j2me", "avant", "docomo", "novarra", "palmos", "palmsource", "240x320", "opwv", "chtml", "pda", "windows ce", "mmp/", "blackberry", "mib/", "symbian", "wireless", "nokia", "hand", "mobi", "phone", "cdm", "up.b", "audio", "SIE-", "SEC-", "samsung", "HTC", "mot-", "mitsu", "sagem", "sony", "alcatel", "lg", "eric", "vx", "NEC", "philips", "mmm", "xx", "panasonic", "sharp", "wap", "sch", "rover", "pocket", "benq", "java", "pt", "pg", "vox", "amoi", "bird", "compal", "kg", "voda", "sany", "kdd", "dbt", "sendo", "sgh", "gradi", "jb", "dddi", "moto");

foreach($uamatches as $uastring){
if(preg_match("/".$uastring."/i",$_SERVER["HTTP_USER_AGENT"])) return true;

return false;

echo '
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
Hello Mobile User, Welcome to


echo 'NOT you are using a mobile phone';


check it out, if you have a mobile phone or device and you are have access to internet, go to and you will be automatically directed to our mobile website

Try it!!

to actually detect what device is browsing your site, or requesting the mobile content, you can use handsetdetection which actually tells you the screen size of the device and other device characteristics
redirection is important but once the user lands on your mobile site you'll need to make sure the mobile site is working on all mobile phones. you'll need at some point a mobile detection system that will provide you with phone specifications like this: (online) (online and offline)
you can easily determine that a request is coming from a what mobile device using

apart from identifying mobile devide this api gives detailed information of the device making the request and also has the facility to redirect user automatically to mobile specific page when request in coming from mobile device.

i found this more powerful and easy to implement in my mobile website developments.

sorry url was not proper in last post.
editor is not accepting urls so here is the way to go for info.

- please goto website
- look for products->netmobileapi
Hey this is the gr8 stuff but it fails when i try to open it useing i-phone,why it is so
hey, i love it cellphonebeta.
the quality of it is satisfying, and the function is easy to perform
Title: How To Detect Mobile Browsers Wireless Cellphone Users Visiting Your Site [1435]
Tags: how to detect mobile browsers wireless cellphone users visiting your site
Comments 8
Visits 2878