www.gusucode.com > 网站优化(SEO)新闻系统 2008源码程序 > manage/manager_add_save.asp

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn_news.asp" -->
<!--#include file="config.asp" -->
<!--#include file="chklogin.asp" -->
<!--#include file="chkerror.asp" -->
<% chk_user_login(3) %>
<!--#include file="md5.asp" -->
<!--#include file="include/inc_type.asp" -->
<% 
if request.Form("u_tid") = "" or request.Form("u_name") = "" or request.Form("u_password") = "" then
response.Write(err&err_null)
response.end 
end if
%>
<%

if(request.form("u_name") <> "") then Command1__mmname = request.form("u_name")

if(request.form("u_level") <> "") then Command1__mmlevel = request.form("u_level")

if(request.form("u_password") <> "") then Command1__mmpassword = md5(request.form("u_password"))

if(request.form("u_tid") <> "") then Command1__mmtid = request.form("u_tid")

%>
<%
Dim rsu__MMColParam
rsu__MMColParam = "1"
If (Request.Form("u_name") <> "") Then 
  rsu__MMColParam = Request.Form("u_name")
End If
%>
<%
Dim rsu
Dim rsu_numRows

Set rsu = Server.CreateObject("ADODB.Recordset")
rsu.ActiveConnection = MM_conn_news_STRING
rsu.Source = "SELECT * FROM t_user WHERE u_name = '" + Replace(rsu__MMColParam, "'", "''") + "'"
rsu.CursorType = 0
rsu.CursorLocation = 2
rsu.LockType = 1
rsu.Open()

rsu_numRows = 0
%>
<%
If rsu.EOF And rsu.BOF Then
%>
<%

set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_conn_news_STRING
Command1.CommandText = "INSERT INTO t_user (u_name, u_level, u_password,u_tid)  VALUES ('" + Replace(Command1__mmname, "'", "''") + "','" + Replace(Command1__mmlevel, "'", "''") + "','" + Replace(Command1__mmpassword, "'", "''") + "','" + Replace(Command1__mmtid, "'", "''") + "') "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
%>
<meta http-equiv="refresh" content="1;URL=manager.asp">
添加管理员成功, 等待返回...
<%
else
Response.write"你的用户名已经有人使用了"
End If

%>
<%
rsu.Close()
Set rsu = Nothing
%>