www.gusucode.com > 星云DJ舞曲 4.5a源码程序 > admin/admin_toplinksave.asp

    <!--#include file="function.asp"-->
<%CheckAdmin2%>
<!--#include file="conn.asp"-->
<!--#include file="inc/char.inc"-->
<%
ID=trim(request.QueryString("id"))
Name=trim(request.form("Name"))
Url=trim(request.form("Url"))
intro=trim(request.form("intro"))
founerr=false
act=request("act")
if Name="" then
	founderr=true
	errmsg="<br><li>名称不能为空</li>"
end if
if Intro="" then
	founderr=true
	errmsg="<br><li>简介不能为空</li>"
end if
if Url="" then
	founderr=true
	errmsg="<br><li>地址不能为空</li>"
end if
if founderr=true then
	call error()
else
	set rs=server.createobject("adodb.recordset")
	if act="edit" and id<>"" then
		sql="select * from TopLink where ID="&ID
	elseif act="add" then
		sql="select * from TopLink"
	else
		errmsg="<br><li>操作错误!请联系管理员</li>"
		call error()
		response.end
	end if
	rs.open sql,conn,1,3
	if act="add" or act="edit" then
		if act="edit" then
			if rs.eof then
				errmsg="<br><li>操作错误!请联系管理员</li>"
				call error()
				response.end
			end if
		end if
		if act="add" then
			rs.addnew
		end if
		rs("Name")=Name
		rs("intro")=intro
		rs("Url")=Url
		rs.update
	end if
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Redirect "admin_TopLinkMana.asp"
end if
%>