www.gusucode.com > 蓝影会员系统(淡蓝色经典)源码程序 > tj.asp
<!--#include file="conn.asp" --> <!--#include file="md5code.asp" --> <% '====================判断管理员是否有登陆===================== if session("name")="" and session("pass")="" then response.write"<SCRIPT language=JavaScript>alert('请您登陆后,再进入这个页面!');" response.write"this.location.href='index.asp';</SCRIPT>"'转向到index.asp end if %> <META content="免费主页、免费空间、个人主页、域名注册、虚拟主机、企业邮局、主机租用、主机托管、网站推广、智能建站、建站服务、网站建设、通用网址、网络实名、域名抢注、国际域名、国内域名" name=keywords> <title>虫影设计网-个人主页基地|免费空间|免费主页|网页制作|网站建设|平面设计|域名注册|网站推广|网站维护...</title> <% if request("action")="tj" then name=replace(trim(request.form("name")),"'","") pass=replace(trim(request.form("pass")),"'","") pass2=replace(trim(request.form("pass2")),"'","") if name="" or len(name)>8 or len(name)<2 then response.write "<SCRIPT language=JavaScript>alert('请输入管理员姓名(不能大于8小于2)');" Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>" Response.End end if if pass="" or len(pass)>16 or len(pass)<6 then response.write "<SCRIPT language=JavaScript>alert('密码长度为6-16个字符');" Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>" Response.End end if if pass2="" then response.write "<SCRIPT language=JavaScript>alert('确认密码不能为空');" Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>" Response.End else if pass<>pass2 then response.write "<SCRIPT language=JavaScript>alert('密码和确认密码不一致');" Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>" Response.End end if end if set rs=server.CreateObject("adodb.recordset") rs.open "select * from gl where name='"&trim(request("name"))&"'" ,conn,1,1 if rs.recordcount>0 then response.write "<script language=javascript>" response.write "alert('已经有此管理员了!');" response.write "javascript:history.go(-1);" response.write "</script>" Response.end else '========================验证是否有重复申请(结束)以下是将表单的内容插入到数据库中============================ set rs=server.createobject("adodb.recordset") sql="select * from gl" rs.open sql,conn,1,3 rs.addnew name=request.form("name") pass=md5(request.form("pass")) rs("name")=name rs("pass")=pass rs.update rs.close conn.close set rs=nothing response.redirect "gldel.asp" end if end if %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>无标题文档</title> <style type="text/css"> <!-- body { margin-top: 0px; } .unnamed1 { height: 15px; width: 150px; border: 1px solid; } --> </style></head> <body background=img/back.jpg> <table width="770" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><!--#include file="tou.asp" --></td> </tr> </table> <table width="80%" height="2" border="0" cellpadding="0" cellspacing="0" id="sdfsfdsf"> <tr> <td></td> </tr> </table> <table width="770" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="176"><form name="form1" method="post" action="tj.asp?action=tj"> <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"><strong>添加管理员</strong></div></td> </tr> </table> <table width="80%" height="3" border="0" cellpadding="0" cellspacing="0" id="123412312"> <tr> <td></td> </tr> </table> <table width="80%" border="0" align="center" cellpadding="0" cellspacing="2"> <tr> <td width="31%"> </td> <td width="16%">管理员:</td> <td width="53%"><input name="name" type="text" class="unnamed1" id="name"></td> </tr> <tr> <td> </td> <td>密 码:</td> <td><input name="pass" type="password" class="unnamed1" id="pass"></td> </tr> <tr> <td> </td> <td>确认密码:</td> <td><input name="pass2" type="password" class="unnamed1" id="pass2"></td> </tr> <tr> <td colspan="3"><div align="center"> <input type="submit" name="Submit" value="增加"> <input type="reset" name="Submit" value="重填"> </div></td> </tr> </table> </form></td> </tr> </table> <br> <table width="770" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><!--#include file="down.asp" --></td> </tr> </table> </body> </html>