Forums »
  Tutorial And Guides Forums And Topics Discussions For Help »
    How To Detect Mobile Browsers Wireless Cellphone Users Visiting Your Site

How To Detect Mobile Browsers Wireless Cellphone Users Visiting Your Site

Description: How To Detect Mobile Browsers Wireless Cellphone Users Visiting Your Site
Tags: how ,to ,detect ,mobile ,browsers ,wireless ,cellphone ,users ,visiting ,your ,site
Posted On Fri Apr 04, 2008 By hostman In Tutorial And Guides Forums And Topics Discussions For Help Forums
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

<?php

function checkmobile(){

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

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

if(isset($_SERVER["HTTP_USER_AGENT"])){

$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;
}

if(checkmobile()){
echo '
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<title>Google</title>
</head>
<body>
Hello Mobile User, Welcome to Wallpaperama.com
</body>

</html>

';
}else{
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
http://www.wallpaperama.com and you will be automatically directed to our mobile website

Try it!!

Meghan Wed Mar 16, 2011
the quality of it is satisfying, and the function is easy to perform
Meghan Tue Mar 15, 2011
hey, i love it cellphonebeta.
Siddharth Sun Mar 13, 2011
Hey this is the gr8 stuff but it fails when i try to open it useing i-phone,why it is so
Amit Thu Jul 23, 2009
editor is not accepting urls so here is the way to go for info.

- please goto 51degrees.mobi website
- look for products->netmobileapi
Amit Thu Jul 23, 2009
sorry url was not proper in last post.

51degrees.mobi/product
Amit Thu Jul 23, 2009
you can easily determine that a request is coming from a what mobile device using 51degrees.mobi/products/netmobileap

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.

thanks
Klint Tue Jun 30, 2009
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:
mobilemultimedia.be (online)
wurfl.sourceforge.net (online and offline)
david Wed Jul 16, 2008
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
Information
Title: How To Detect Mobile Browsers Wireless Cellphone Users Visiting Your Site
Info: This Post Has Been Viewed 0 Times Since
Date: Fri Apr 04, 2008
Author hostman Received 8 Replies #1435
Related Content
Related Pages
Related Sites
Add Your Website
Share
wallpaperama | Wallpapers | Forums | Terms Of Service

copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Wed Jun 19, 2013 (-8 GMT)
Powered by: Webune Forums V5