Detecting Users Browser
As a web developer, the issues i always encounter are from web browsers,..
When creating CSS, Javascript codes, specially with Ajax, there will be always a conflict on Web Browsers.. Common problems are floating Divs.. Thats why you need to detect users browsers so that you could switch on your style sheets..
In Php heres a very easy code:
if (strpos($_SERVER['HTTP_USER_AGENT'], ‘Firefox’) !== FALSE) {
//Your code goes in here
}
List of Common Browsers:
Firefox = ‘Firefox’
IE = ‘MSIE’
Netscape = ‘Netscape’
Opera= ‘Opera’
By the time your page was loaded the $_SERVER['HTTP_USER_AGENT'] automatically registers your web browser name.
No comments yet
Leave a reply