Darksat IT Security Forums
June 25, 2018, 08:00:17 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Darksat IT Security Forum
From Firewall Support, AntiVirus Questions, Spyware problems, Linux and Windows Security, Black Hat SEO right down to Website Design and Multimedia
  Home Help Search Gallery Links Staff List Login Register  

PHP Browser detection/sniffing

Pages: [1]
Author Topic: PHP Browser detection/sniffing  (Read 1017 times)
Posts: 3303

View Profile WWW
« on: May 07, 2009, 06:12:32 am »

This code lets you detect IE6 and checks for opera in the user agent to make sure your not picking up a version of opera spoofing as IE6.

if (strstr($_SERVER['HTTP_USER_AGENT'],"MSIE 6")
&& !(strstr($_SERVER["HTTP_USER_AGENT"], "Opera"))
echo "<link rel='stylesheet' type='text/css' href='Styles/ie6hacks.css'>";

You can replace the IE6 value with whatever value you want.
if (strstr($_SERVER['HTTP_USER_AGENT'],"firefox 2.0")
if (strstr($_SERVER['HTTP_USER_AGENT'],"firefox 3.0")

Happy sniffing
Report Spam   Logged

Social Buttons

Pages: [1]
Jump to:  

Powered by EzPortal
eXTReMe Tracker
Security Forum
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Buy traffic for your forum/website
Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy
Page created in 0.078 seconds with 11 queries.