0

I was wondering if you could use just a part of the user agent string, for example the firmware, on the web. However, Flash will not work because I need it to work on iOS. This is a follow-up question to the one here. I have tried googling it, but found only Microsoft-specific stuff and stuf that was completely off topic.

Community
  • 1
  • 1
Zungy
  • 13
  • 9

3 Answers3

1

In javascript, the value of navigator.userAgent tells you what you need. Stick this in your <head>:

<script>
    alert(navigator.userAgent);
</script>
Rich Bradshaw
  • 71,795
  • 44
  • 182
  • 241
0

With PHP you can check $_SERVER['HTTP_USER_AGENT'] and parse the information from there.

Just to get more details:
What languages are you programming in?

Update
Here's a link which lists a good amount of User-agent strings and breaks them down: Maybe that'll help you in your endeavors. Seems pretty straight forward, and shows how the headers are constructed (for the most part)

Zungy
  • 13
  • 9
Tango Bravo
  • 3,221
  • 3
  • 22
  • 44
  • HTML, PHP, JavaScript, ASP, anything except Flash. I know the mobile Safari user agents show firmware, which is all I need. Yes, I've [looked](http://www.useragentstring.com/). – Zungy Feb 05 '12 at 16:12
  • Also, is there a way to just get firmware from the user agent? – Zungy Feb 05 '12 at 16:14
  • Well, I guess I'm confused about your question. Are you asking us to show you how to parse it? Maybe I'm not totally getting what you're asking. – Tango Bravo Feb 05 '12 at 16:14
  • Yeah, kinda. All I need is the firmware. – Zungy Feb 05 '12 at 16:20
  • This should probably be moved to chat, and also, why don't you edit your original post to show what you have tried? – Tango Bravo Feb 05 '12 at 16:23
  • Ok how do you do that? Sorry im kinda new. – Zungy Feb 05 '12 at 16:25
0

I figured something like that out. Just do a user agent (navigator.useragent) and then make some variables (model, firmware, device...). Then set values to those variables based on the useragent

Zungy
  • 13
  • 9