Solved

need help finding phone model in php

Posted on 2014-07-30
8
148 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 83

Expert Comment

by:Dave Baldwin
ID: 40230970
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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
 
LVL 109

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

786 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