www.gusucode.com > 25175 学生成绩管理查询系统码程序 > user_manager.asp
<!-- #include file="config.asp" --> <!-- #include file="conn.asp" --> <!-- #include file="inc/md5.asp" --> <!-- #include file="inc/function.asp" --> <% Dim fso,htmlwrite Dim strTitle,strContent,strOut '// 创建文件系统对象 Set fso=Server.CreateObject("Scripting.FileSystemObject") '// 打开网页模板文件,读取模板内容 Set htmlwrite=fso.OpenTextFile(Server.MapPath("skin/Default2/Template_info.html")) strOut=htmlwrite.ReadAll htmlwrite.close strTitle="生成的网页标题" strContent="生成的网页内容" action=Checkstr(request.querystring("action")) If action="login" Then xh=request("xh") mm=md5(request("mm"),16) if mm="" Or xh="" Then errs=errorinfo("") end If Set rs = Server.CreateObject("ADODB.Recordset") if request("mm")="11111111" then sql="select user.id,xm,bj,lj from user,bjb,ljb where ljbj_id=bjb.id and ljb_id=ljb.id and xh='"&xh&"'" else sql="select user.id,xm,bj,lj from user,bjb,ljb where ljbj_id=bjb.id and ljb_id=ljb.id and xh='"&xh&"' and mm='"&mm&"'" end if Set rs=conn.execute(sql) if rs.eof Then errs=errorinfo("") else session("id")=rs(0) session("xh")=xh session("xm")=rs(1) session("bj")=rs(2) session("lj")=rs(3) rs.close sql="select bjb.id from ljb,bjb where ljb.id=bjb.ljb_id and lj='"&session("lj")&"' and bj='"&session("bj")&"'" Set rs=conn.execute(sql) session("ljbj_id")=rs(0) rs.Close set rs=Nothing End If End If If action="post_js" Then number=request.querystring("number") count=request.querystring("count") dates=request.querystring("dates") response.write post_js(number,count,dates) response.end End If response.write errs %> <html> <head> <title>AJAX Check</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <body> <% '// 用真实内容替换模板中的标记 SystemFolder="skin/Default2/" strOut=Replace(strOut,"$title$",strTitle) strOut=Replace(strOut,"$userinfo_title$",userinfo_title) strOut=Replace(strOut,"$userinfo$",userinfo) strOut=Replace(strOut,"$SystemFolder$",SystemFolder) strOut=Replace(strOut,"$mainbody$",mainbody) strOut=Replace(strOut,"$usermenu$",usermenu) If action="" Then action="cj" strOut=Replace(strOut,"$maintop$",maintop(action)) strOut=Replace(strOut,"$maintop_title$",maintop_title(action)) strOut=Replace(strOut,"$maininfo$",maininfo(action)) response.write strout '// 创建要生成的静态页 'Set htmlwrite=fso.CreateTextFile(Server.MapPath("test.htm"),true) '// 写入网页内容 'htmlwrite.WriteLine strOut 'htmlwrite.close 'Response.Write "生成静态页成功!" '// 释放文件系统对象 'set htmlwrite=Nothing 'set fso=Nothing %>