标题: 急:服务器端脚本如何用vbscript在浏览器上显示对话框. [打印本页] 作者: 梦缘o☆无恒 时间: 2010-1-18 08:53 标题: 急:服务器端脚本如何用vbscript在浏览器上显示对话框. 服务端脚本如何将下划线部分改为vbscript
<%
dim txtaccount,txtpsw
txtaccount=trim(request.form("username"))
txtpsw=trim(request.form("password"))
dim conn
set conn=server.createobject("ADODB.Connection")
conn.connectionstring="driver={sql server};server=192.168.8.33;uid=sa;pwd=sa;database=message"
conn.open
dim strsql
strsql="select * from login where account='"&txtaccount&"'"
dim rs
set rs=server.createobject("ADODB.RecordSet")
rs.open strsql,conn,1,1
if rs.eof then
response.write("<script language='javascript'>alert('帐号不正确');history.back();</script>")
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect("login.htm")
response.end()
elseif rs("password")<>txtpsw then
response.write("<script language='javascript'>alert('密码不正确');history.back();</script>")
rs.close
set rs=nothing
conn.close
set conn=nothing
response.end()
else
rs.close
set rs=nothing
conn.close
set conn=nothing
session("islogin")="ok"
session("account")=txtaccount
response.redirect("index.asp")
end if
%>作者: 城市之肺 时间: 2010-1-18 08:54
response.write("<script language='javascript'>alert('密码不正确');history.back();</script>")
有了response.redirect("index.asp") 你还想执行客户端脚本 那是不可能的