Browser Sniffer

Here’s a short PHP script that gathers info about the browser and the IP address of the client and returns it via email. I used it to gather data on cell phone browsers, and got the results seen at the bottom over the course of a day. Thanks to all those folks who hit it.

Technorati Tags: , ,

	Phone Finder
	Language: PHP  

	Identifies the user agent and IP address.  Runs on mobile phones.

  $userAgent =  $_ENV["HTTP_USER_AGENT"];
  $ipAddress =  $_ENV["REMOTE_ADDR"];
  sendEmail('', 'user agent', "$userAgent $ipAddress");

  	echo <<<END

	<h2>Hi There</h2>
		Your IP: $ipAddress<br>
		Your browser: $userAgent<br>

function sendEmail($to, $subject, $message) {
	$from = "";
	mail($to, $subject, $message, "From: $from");

Here’s a sampling of some of the phones that hit it. IP addresses deleted to protect the innocent:

Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/
NokiaN73-1/2.0628.0.0.1 S60/3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1
NokiaN93-1/20.0.058 SymbianOS/9.1 Series60/3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1
Nokia6230/2.0 (05.51) Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/
BlackBerry8100/4.2.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100
BlackBerry7290/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100
LGE-PM325/1.0 UP.Browser/ (GUI) MMP/2.0
Palm680/RC1 Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; PalmSource/Palm-D053; Blazer/4.5) 16;320x320 UP.Link/
Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; PPC; 240x320) BlackBerry8100/4.2.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100
Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; PalmSource/Palm-D052; Blazer/4.5) 16;320x320
SAMSUNG-SGH-A707/1.0 SHP/VPP/R5 NetFront/3.3 SMM-MMS/1.2.0 profile/MIDP-2.0 configuration/CLDC-1.1 UP.Link/
Mozilla/4.0 (MobilePhone RL-4920/US/1.0) NetFront/3.1 MMP/2.0
Mozilla/4.0 Sprint:MotoQ (compatible; MSIE 4.01; Windows CE; Smartphone; 176x220)
SonyEricssonW810i/R4CE Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/
Nokia6682/2.0 (4.62.0) SymbianOS/8.0 Series60/2.6 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/
MOT-RAZRV3xx/96.71.95R BER2.2 Mozilla/4.0 (compatible; MSIE 6.0; 11063081) Profile/MIDP-2.0 Configuration/CLDC-1.1  Opera 8.00 [en] UP.Link/