Solved

How to get browser information before loading a website?

Posted on 2013-06-20
5
287 Views
Last Modified: 2013-06-22
Hi

I need to get the following before loading a website:

1. Browser type (Mobile or PC)
2. Screen resolution
3. OS

Based on the info, redirect to a specific version of my site or load diferent CSS.

Thanks in advance.
0
Comment
Question by:dimensionav
5 Comments
 
LVL 19

Expert Comment

by:Patricksr1972
ID: 39263925
Hi,

Clear question but not complete, in what language do you need this detection? php? asp .net?
0
 

Author Comment

by:dimensionav
ID: 39263947
PHP, please.
0
 
LVL 7

Expert Comment

by:rgranlund
ID: 39264013
<?php
if(strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPod'))
 {
  <link rel="stylesheet" type="text/css" media="all" href=" " />
}
?>

Open in new window

So that is if it is an iPhone or IF it is a iPad use this CSS
0
 
LVL 19

Assisted Solution

by:Patricksr1972
Patricksr1972 earned 250 total points
ID: 39264025
Hi

My advise is to start with get_browser()

For screen resolution i would recommend Javascript not php like:

var screenWidth = window.screen.width,
    screenHeight = window.screen.height;
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 250 total points
ID: 39264301
This is a good library http://detectmobilebrowsers.com
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now