Session中保存登录成功信息的时间 dim db '以下连上数据库,建立一个Connection对象实例db set db=Server.Createobject("ADODB.Connection") db.Open "DBQ="&;Server.Mappath("maindata.mdb")&;";DRIVER={Microsoft Driver (*.mdb)};" dim strSql,rs,strSql1 strSql="Select * From user" set rs=db.execute(strSql) dim a1,a2,nam,psw,otherpwd,reotherpwd a1=Request.Form("user") a2=Request.Form("password") otherpwd=Request.Form("otherpwd") reotherpwd=Request.Form("reotherpwd") do while not rs.Eof nam=rs("user_name") rem 利用decrypt函数还原用户密码 psw=decrypt(rs("password")) if reotherpwd<>otherpwd then Response.Write "附加码不对!
" Response.Write "重新登录" Response.End end if if a1=nam and a2=psw then session("pass")="action1" '将登录成功的信息保存在session中 response.Redirect("default.asp") '如果用户名、密码正确,登录成功, 引导到另一张网页 Response.End end if rs.movenext loop Response.Write "用户信息不正确
*博文纂写edit_article.asp <% option explicit if session("login")<>"yes" then response.write "确认?" response.End() end if %>
<% dim sql,title,content,src,id id=request.QueryString("id") sql="Select * From article where id=" &; id rs.open sql,conn,1,3 title=rs("title") content=rs("content") src=rs("src") if request.form("update")<>"submit" then %>
撰写文章
<% else title=trim(request.form("title")) content=trim(request.form("content")) if content="" then content="鏃犲唴瀹? src=trim(request.form("src")) if src="" then src="鏃犲唴瀹? rs("title")=title rs("content")=content rs("src")=src rs.update response.Redirect("list_article.asp") end if rs.Close conn.Close set rs=nothing set conn=nothing type="reset" name="Submit2" value="重写"> type="hidden" name="update" name="content" cols="70" rows="15"><%=content%> %>
<% sql = "select * from re order by id desc" rs.Open sql, cn, 0, 1, 1 http-equiv="Content-Type" content="text/html; html PUBLIC "-//W3C//DTD XHTML 1.0 "w3.org/TR/xhtml1/DTD/xhtml1- if not rs.EOF then do while not rs.EOF '核心代码开始 set h = new MD5 '载入MD5实例 hash = h.hash(""&;rs("email")&;"") '指定在Gravatar中的email地址 noPicUrl jpg") '设定默认图片 '核心代码结束 %>