火狐浏览器判断代码(ASP+PHP)

2008年6月9日 由 Sken 留言 »

ASP版

<%
Dim BrowserString,broFirefox
BrowserString = Request.ServerVariables(“HTTP_USER_AGENT”)
BrowserString = Lcase(BrowserString)
broFirefox = “firefox”

if Instr(BrowserString, broFirefox) <> 0 then
response.write(“恭喜,您是firefox用户”)
else
response.write(“非firefox用户,不能看”)
end if
%>

PHP版

<?
$browser=$_SERVER[“HTTP_USER_AGENT”];
$pan= “Firefox”;
$u=strpos($browser,$pan);
if (empty($u)){
echo”非firefox用户,不能看”;
}
else{
echo”恭喜,您是firefox用户”;
}
?>

广告位

评论已关闭.