Darksat IT Security Forums
April 23, 2017, 05:26:38 pm
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]
  Print  
Author Topic: PHP Browser detection/sniffing  (Read 979 times)
Darksat
Administrator
Master
*******
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.

Code:
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.
eg
Code:
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]
  Print  
 
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
traffic-masters
Powered by SMF | SMF © 2016, Simple Machines
Page created in 0.094 seconds with 11 queries.