web phone app

bobby101
bobby101 used Ask the Experts™
on
HI

I have a done app and hosting it on a server and wondering how to allow a person if there accessing it from a mobile device and not allow ppl who use the comp to access it???
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You may wanna try to identify the browser id. Each browser sends an ID that you can capture and then based on this ID do something according to it.
Check here:

http://www.zytrax.com/tech/web/browser_ids.htm

With this you can code your app saying that if it comes over a PC browser deny the access and if not allow it...up to you :)
Check this for mobile browser IDs so you can do the other way:

http://www.zytrax.com/tech/web/mobile_ids.html
Most Valuable Expert 2011
Top Expert 2016

Commented:
This information is "external data" and may be subject to tampering.  That said, look at this variable:
$_SERVER['HTTP_USER_AGENT']

You can find it if you run phpinfo();

The notes on the get-browser page are useful, and see especially this note (looks like get-browser has some problems):
http://www.php.net/manual/en/function.get-browser.php#88923

In order for get-browser to work, your browscap configuration setting in php.ini must point to the correct location of the browscap.ini file on your system.  browscap.ini is not bundled with PHP.  It relies on user updates to keep the database current.
Well the php example is just that, the possibility to do it on several languages. He might be using ASP, or just simple HTML.
Anyway, here is another sample on jscript:

http://www.quirksmode.org/js/detect.html

The idea is to detect the userAgent and using it decide what to do with his app

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial