Solved

need help finding phone model in php

Posted on 2014-07-30
8
157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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 110

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: 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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Node.js 11 82
WordPress  Failed to Import Media 8 67
Bootstrap - BootBox - PHP - MYSQL - Response Trigger 6 62
syntax error, unexpected end of file 4 19
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
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 and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

752 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