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用户”;
}
?>