一个留言板的删除页面,主要实现的功能是判断session(mode)值是否等于1,和request("nume")值是否等于DEL,分别调用del()和check()程序.如果都不相等,那么调用index()程序,代码如下,一进入页面漆黑一片,什么也没,也不提示错误!!!! 
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> 
<!-- #include file="conn.asp" --> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
<title>删除留言</title> 
<% 
sub del() 
   conn.execute("delete * from gbook where id in ("&id&")") 
   response.Write("<script> alert('留言删除成功,单击“确定”返回!');location.href='index.asp';</script>") 
   response.End()   
end sub 
sub check() 
dim pwd  
pwd=request.form("password") 
set rs=server.CreateObject("adodb.recordset") 
sqlstr="select * from admin where password='"&pwd&"'" 
rs.open sqlstr,conn,1,1 
if rs.eof or rs.bof then 
  response.Write("<script> alert('密码不正确!');location.href='index.asp'</script>") 
  response.End() 
else 
   call del() 
   session("mode")=1 
end if 
end sub 
sub index() 
%> 
<form method="post" name="form" action="delete.asp"> 
<table  align="center" width="150" bordercolor="#00CC33" border="1" cellpadding="0" cellspacing="0"> 
  <tr> 
    <td align="center"><font color="#00CC33" face="华文行楷">请输入密码</font></td> 
<input type="hidden" name="nume" value="del" /> 
  </tr> 
  <tr> 
    <td align="center"><input type="password" size="15" name="password"/></td> 
  </tr> 
  <tr> 
    <td align="center"><input type="submit" name="submit" value="确定"/></td> 
  </tr> 
</table> 
</form> 
<% 
end sub  
%> 
</head> 
<body bgcolor="#000000"> 
<% 
if request("nume")=del then  
   call check() 
elseif session("mode")=1 then 
   call del() 
else  
   call index() 
end if  
%> 
</body> 
</html>