Log in

View Full Version : Browser Sniffing Help Needed - Coders?


medic119
01-23-2003, 03:18 AM
I am trying to create a simple PHP browser sniffer for a website. The problem I am having is that for some reason I can't get it to "sniff" Pocket IE and redirect accordingly. I am sure I am missing something USer Agent wise and I have nowehere else to turn left but the PocketPC experts.

The code block is below:

<?
if ((stristr($_SERVER['HTTP_USER_AGENT'],"palmos")) or (stristr($_SERVER['HTTP_USER_AGENT'],"blazer")) or (stristr($_SERVER['HTTP_USER_AGENT'],"mozilla/2.0")) or (stristr($_SERVER['HTTP_USER_AGENT'],"wap")) or (stristr($_SERVER['HTTP_USER_AGENT'],"avantgo"))) header("Location: http://www.thewebsite.net/pda.php");

if (stristr($_SERVER['HTTP_USER_AGENT'],"lynx")) header("Location: http://www.thewebsite.net/pda.php");
?>


The problem line is (of course)

(stristr($_SERVER['HTTP_USER_AGENT'],"mozilla/2.0"))


I have tried mozilla/3.0, MSIE 3, windows ce, pocket pc, and all the other variations of user agent strings I could dig up.

Any help would be appreciated.