Solved

need help finding phone model in php

Posted on 2014-07-30
8
144 Views
Last Modified: 2014-08-11
I am placing this code  on top of my webpage  and
<?

$phonemodel=$_SERVER['HTTP_USER_AGENT'];

?>

then on the html section I am calling it like this below
<?php
 echo $phonemodel;
 ?>

my issue is that what returns is
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36

and all i would love to get is the model of the phone....


any ideas?
0
Comment
Question by:giancarlo barraza
8 Comments
 
LVL 4

Expert Comment

by:ambatihp
ID: 40230944
Are these cisco phones ?
If they are cisco phones they give you additional headers to identify the phone model.
0
 

Author Comment

by:giancarlo barraza
ID: 40230950
iphone, androd
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40230970
0
 
LVL 11

Accepted Solution

by:
Murfur earned 500 total points
ID: 40231324
Using javascript you can use navigator.platform which will say "iPhone" for an iPhone, "iPad" for an iPad and so on e.g.:
<script type="text/javascript">
function getSpecs() {
    var v = "Vendor: " + navigator.vendor;
    var p = "Platform: " + navigator.platform;
    var an = "App Name: " + navigator.appName;
    var av = "App Version: " + navigator.appVersion;

    document.getElementById("specs").innerHTML = v + "<br/>" + p + "<br/>" + an + "<br/>" + av + "<br/>";
}
</script>
<button onclick="getSpecs()">Click me</button>
<p id="specs"></p>

Open in new window


and you can parse navigator.appVersion to get to common browser name & version e.g. Firefox v31.0

Pretty much every option you can use can be found at the very excellent http://browserspy.dk
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40231365
0
 
LVL 14

Expert Comment

by:Renante Entera
ID: 40231454
Hi giancarlo barraza, if you want to be more specific with what model then you could simply use DeviceAtlas but it is NOT FREE.

You can check their site here => https://deviceatlas.com/
0
 

Author Comment

by:giancarlo barraza
ID: 40232372
do you have to install in server?
0
 
LVL 14

Expert Comment

by:Renante Entera
ID: 40234570
Actually, there is no need to install in server...

You can use their APIs but it is not free.  For Cloud API, they have free trial.

Check this out https://deviceatlas.com/resources/download-cloud-api.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now