if request("user")="" then
response.write "<script language=javascript>alert('请填写管理员');</script>"
Response.End()
else
if request("password")="" then
response.write "<script language=javascript>alert('请填写密码');</script>"
Response.End()
else
response.write"<script language=javascaript> alter('添加成功');</script>"
end if
end if

解决方案 »

  1.   

    在打问号的地方添加
    window.history.back();

    window.location.href='url';
      

  2.   

    <%if request("action")="add" then
          if request("user")="" then
             response.write "<script language=javascript>alert('请填写管理员');window.history.back();</script>"
      else if request("password")="" then
             response.write "<script language=javascript>alert('请填写密码');window.history.back();</script>"
      end if
           
         dim rs,sql
     set rs=server.CreateObject("adodb.recordset")
     sql="select * from admin"
     rs.open sql,conn,1,3
     rs.addnew
     rs("admin")=request("user")
     rs("password")=request("password")
     rs("data")=date()
     rs.update
     response.write "<script language=javascript>alert('添加成功');</script>"
     rs.close
     set rs=nothing
     conn.close
     set conn=nothing
     end if
     end if
     %>
    哪位大哥再帮忙看一下,这段该怎么改!数据在每次输入数据的时候都会向数据库里 添加数据,循环可能有问题
      

  3.   

    试试:
    <%if request("action")="add" then
          if request("user")="" then
             response.write "<script language=javascript>alert('请填写管理员');window.history.go(-1);</script>"
      else if request("password")="" then
             response.write "<script language=javascript>alert('请填写密码');window.history.go(-1);</script>"
      end if
           
         dim rs,sql
     set rs=server.CreateObject("adodb.recordset")
     sql="select * from admin"
     rs.open sql,conn,1,3
     rs.addnew
     rs("admin")=request("user")
     rs("password")=request("password")
     rs("data")=date()
     rs.update
     response.write "<script language=javascript>alert('添加成功');</script>"
     rs.close
     set rs=nothing
     conn.close
     set conn=nothing
     end if
     end if
     %>