Jump to content

Get browser type


The Praetorian

Recommended Posts

Try $_SERVER["HTTP_USER_AGENT"] (by using phpinfo() and then searching for mozilla in the output you would find this... :) )

Link to comment
Share on other sites

One way is what Mr_CHISOL said with the $_SERVER['HTTP_USER_AGENT']. Be aware that the browser type can be easily forged so they might be seeing Internet Explorer while using Firefox.

<?php  $browser=$_SERVER['HTTP_USER_AGENT'];  if (stripos($browser, 'MSIE')!==false) {    echo 'You\'re using Internet Explorer.';  }  elseif (stripos($browser, 'Firefox')!==false) {    echo 'You\'re using Firefox.';  }  else {    echo 'You\'re not using Internet Explorer or Firefox.';  }?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...