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.
Asked
Active
Viewed 131 times
0
-
*"Flash will not work."* Hm. Any details you might want to add to that statement? – Tomalak Feb 05 '12 at 16:04
-
@Tomalak I need it to work on iOS. – Zungy Feb 05 '12 at 16:06
3 Answers
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
-
-
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
-
-
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
-
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