server2=cstr(request.servervariables("server_name"))
if mid(server1,8,len(server2))<>server2 ">

vbscript和javascript之间的函数的调用

80酷酷网    80kuku.com

  javascript|vbscript|函数

<%
server1=cstr(request.servervariables("http_referer"))
server2=cstr(request.servervariables("server_name"))
if mid(server1,8,len(server2))<>server2 then
 response.end()
end if
keyword=vb_unescape(request("keyword"))
keyword=replace(keyword,"'","''")
set conn=server.createobject("ADODB.CONNECTION")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../***")
conn.open connstr

str=""
set rs=conn.execute("select top 25 * from mp3 where mp3name like '%"&keyword&"%' order by len(mp3name)")
if rs.eof and rs.bof then
 response.Write("没有找到")
else
 i=1
 for i=1 to 25
  if rs.eof then exit for
  str=str&i&".<span onClick=""opener.mkList('"&rs("mp3url")&"','"&rs("mp3name")&"');"">"&rs("mp3name")&"</span><a href='"&rs("mp3url")&"'>下载</a>
"
  rs.movenext
 next
end if
str=vb_escape(str)
response.Write(str)
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<script language="javascript" runat="server">
function vb_escape(str)
{
 return escape(str);
}
function vb_unescape(str)
{
 return unescape(str);
}
</script>



分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: