• Announcements

    • xper

      MSFN Sponsorship and AdBlockers!   07/10/2016

      Dear members, MSFN is made available via subscriptions, donations and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, become a site sponsor and ads will be disabled automatically and by subscribing you get other sponsor benefits.
Tripredacus

User Agent detection

4 posts in this topic

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.

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.