Call to function between VBScript and JavaScript

Source: Internet
Author: User
Tags end servervariables
javascript|vbscript| function

<%
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 * mp3 where mp3name like '%" &keyword& "% ' ORDER by Len (mp3name)")
If rs.eof and Rs.bof then
Response. Write ("Not Found")
Else
I=1
For I=1 to 25
If Rs.eof then exit for
str=str&i& ". <span style=" "Cursor:hand" "onclick=" "Opener.mklist" ("&rs") & "', '" Mp3url ( "Mp3name") & "');" > "&rs (" Mp3name ") &" </span><a href= ' "&rs (" Mp3url ") &" > Download </a><br> "
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>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.