帮我把这段代码ASP代码用同样意思翻译成PHP
functionGetBot()dims_agentGetBot=""s_agent=Request.ServerVariables("HTTP_USER_AGENT")...
function GetBot()
dim s_agent
GetBot=""
s_agent=Request.ServerVariables("HTTP_USER_AGENT")
if instr(1,s_agent,"googlebot",1) >0 then
GetBot="google"
end if
if instr(1,s_agent,"msnbot",1) >0 then
GetBot="MSN"
end if
if instr(1,s_agent,"slurp",1) >0 then
GetBot="Yahoo"
end if
if instr(1,s_agent,"baiduspider",1) >0 then
GetBot="baidu"
end if
if instr(1,s_agent,"sohu-search",1) >0 then
GetBot="Sohu"
end if
if instr(1,s_agent,"lycos",1) >0 then
GetBot="Lycos"
end if
if instr(1,s_agent,"robozilla",1) >0 then
GetBot="Robozilla"
end if
if instr(1,s_agent,"Sosospider",1) >0 then
GetBot="soso"
end if
if instr(1,s_agent,"spider",1) >0 then
GetBot="sougou"
end if
end function 展开
dim s_agent
GetBot=""
s_agent=Request.ServerVariables("HTTP_USER_AGENT")
if instr(1,s_agent,"googlebot",1) >0 then
GetBot="google"
end if
if instr(1,s_agent,"msnbot",1) >0 then
GetBot="MSN"
end if
if instr(1,s_agent,"slurp",1) >0 then
GetBot="Yahoo"
end if
if instr(1,s_agent,"baiduspider",1) >0 then
GetBot="baidu"
end if
if instr(1,s_agent,"sohu-search",1) >0 then
GetBot="Sohu"
end if
if instr(1,s_agent,"lycos",1) >0 then
GetBot="Lycos"
end if
if instr(1,s_agent,"robozilla",1) >0 then
GetBot="Robozilla"
end if
if instr(1,s_agent,"Sosospider",1) >0 then
GetBot="soso"
end if
if instr(1,s_agent,"spider",1) >0 then
GetBot="sougou"
end if
end function 展开
2个回答
展开全部
<%
str = Request.ServerVariables("URL")
'如果页面为 . str="/xinwen.html"
str = replace(str,"/","")
'str="xinwen.html"
%>
<li class="<%if str = "shipin.html" then response.write "menu_line" end if%>">
<a href="shipin.html" onMouseOver="javascript:ftab(1)" id="nav1" ><span>视 频</span></a></li>
<li class="<%if str = "xinwen.html" then response.write "menu_line" end if%>>
<a href="xinwen.html" onMouseOver="javascript:ftab(2)" id="nav2" ><span>新 闻</span></a></li>
<li class="<%if str = "otherPage.html" then response.write "menu_line" end if%>"></li>
应该是对的
str = Request.ServerVariables("URL")
'如果页面为 . str="/xinwen.html"
str = replace(str,"/","")
'str="xinwen.html"
%>
<li class="<%if str = "shipin.html" then response.write "menu_line" end if%>">
<a href="shipin.html" onMouseOver="javascript:ftab(1)" id="nav1" ><span>视 频</span></a></li>
<li class="<%if str = "xinwen.html" then response.write "menu_line" end if%>>
<a href="xinwen.html" onMouseOver="javascript:ftab(2)" id="nav2" ><span>新 闻</span></a></li>
<li class="<%if str = "otherPage.html" then response.write "menu_line" end if%>"></li>
应该是对的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询