Solved

need help finding phone model in php

Posted on 2014-07-30
8
151 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

830 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