MSFN Forum: User Agent detection - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

User Agent detection Rate Topic: -----

#1 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,676
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 16 January 2011 - 07:52 AM

In my next version of my website I'd like to have my site detect the user agent of the browser and determine how to display the page. This (as a function of coding) isn't a problem for me to do, but my question is a little different. Does the browser on the Droid phones have a specific User Agent that is not something a PC browser uses?

As an example of my meaning, my next phone will be a Droid and I want to be able to connect to my website with it as needed, but I want it to display differently than if I went there from a PC.

Also (I'll eventually get to it) can a website write a cookie to a cellphone? It would be easier to look for cookie first (although using session might be safer) to see what kind of browser it is.


#2 User is offline   geezery 

  • Member
  • PipPip
  • Group: Members
  • Posts: 254
  • Joined: 21-July 06

Posted 17 January 2011 - 05:32 AM

http://detectmobilebrowser.com/

#3 User is offline   tain 

  • Cyber Ops
  • Group: Super Moderator
  • Posts: 3,557
  • Joined: 24-September 05
  • OS:none specified
  • Country: Country Flag

Posted 17 January 2011 - 06:26 AM

The linked site should help you with the detection...the answer is yes, it is in the UA string. And yes, you can store cookies (you're probably wanting to use PHP sessions?) on phones.

#4 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,676
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 17 January 2011 - 11:41 AM

Yes I will be using PHP for the new site. I am still in the planning phase, already backed up the current site to be archived. Now to figure out how I will be arranging the data on the screen.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy