Solved

How to get browser information before loading a website?

Posted on 2013-06-20
5
303 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 22

Expert Comment

by:Patrick Bogers
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 22

Assisted Solution

by:Patrick Bogers
Patrick Bogers 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
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…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

680 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