addchk_2.asp

来自「人才招聘系统,用asp做的」· ASP 代码 · 共 38 行

ASP
38
字号
<!--#include file=../conn.asp-->
<!--#include file=onlinerz.asp-->
<!--#include file=md5.asp-->
<%
	dim sql
	dim rs
	dim username
	dim password,city
	username=replace(trim(request("username")),"'","‘")
	password=md5(request("password"))
	city=request("city")
	if username="" or password="" then
    response.write "<script language=JavaScript>" & chr(13) & "alert('操作错误!你没有输入资料怎么能添加呢?');" & "history.back()" & "</script>"
 	response.end
 	end if
	set rs=server.createobject("adodb.recordset")
	sql="select * from [administrator] where Password='"&Password&"' and UserName='"&UserName&"'"
	rs.open sql,conn,1,3
 	if not rs.bof and not rs.eof then
    response.write "<script language=JavaScript>" & chr(13) & "alert('用户名已经存在,请换个名字!');" & "history.back()" & "</script>"
 	response.end
 	else
	rs.addnew
    rs("username")=username
    rs("password")=password
    rs("yesno")=1
    rs("quyu")=city
    rs.update
	rs.close
	conn.close
	set rs=nothing
	set conn=nothing
	end if

%>
 <meta http-equiv="Content-Language" content="zh-cn">
 <LINK href="img/jobcn.css" rel=stylesheet></LINK>
<p align="center">增加管理员成功 <a href="add.asp">返回</a></p>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?