www.pudn.com > baxun36.rar > admin_detail_add.asp, change:2006-04-19,size:2834b


<!--#include file="mdb.asp"--> 
<% 
if session("adminlogin")<>sessionvar then 
Response.Write("<script language=javascript>alert('你尚未登录,或者超时了!请重新登录');this.location.href='index.asp';</script>") 
Response.End 
End if 
dim action,title,url,leibie,memo 
title=request("title") 
url=request("url") 
leibie=request("leibie") 
action=request("action") 
memo=request("memo") 
if action="add" then 
	if title="" or url="" or leibie="" then 
		response.write "<font color='red'>表单不完整!</font><br>" 
	else 
		set r=server.createobject("adodb.recordset") 
		r.open "select * from detail where title='"&title&"'",conn,1,3 
		r.addnew 
			r("title")=title 
			r("url")=url 
			if memo="" then 
				r("memo")=" "&memo 
			else 
				r("memo")=memo 
			end if 
			r("classid")=leibie 
			r("verity")=1 
			r.update 
			r.close 
			set r=nothing 
			response.write "<font color='red'>新网站添加成功!</font><br>" 
			Response.End 
	end if 
end if 
%> 
<HTML> 
<HEAD> 
<TITLE>网站添加管理</TITLE> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">  
<LINK REL="stylesheet" HREF="css.css" TYPE="text/css"> 
</HEAD> 
<% 
pn=request("pn") 
dim rs(5) 
function listunder(i) 
	set rs(i)=server.createobject("adodb.recordset") 
	rs(i).open "select classid,classname from feilei where topclass="&rs(i-1)("classid"),conn,1,3 
	while not rs(i).eof 
		dim topclassname 
		topclassname="" 
		for x=0 to i-1 
			topclassname=topclassname&rs(x)("classname")&">" 
		next 
		response.write "<option value='"&rs(i)("classid")&"'>"&topclassname&rs(i)("classname")&"</option>"&vbCrLf 
		if i<Ubound(rs) then 
			call listunder(i+1) 
		end if 
		rs(i).movenext 
	wend 
end function 
%> 
<BODY> 
<table width="96%" border="0" cellspacing="1" cellpadding="8" align="center" bgcolor="#999999"> 
  <tr>  
    <td bgcolor="#cccccc" align="center"> 
      网站添加管理</td> 
  </tr> 
  <tr>  
    <td bgcolor="#eeeeee"> 
<br> 
<form action="admin_detail_add.asp" method="post" name="form1"> 
网站标题:<input name="title"><br> 
网站地址:<input name="url" size="35"><br> 
类别名称:<select name="leibie"> 
<option selected value="0">请选择分类</option> 
<% 
set rs(0)=server.createobject("adodb.recordset")   
rs(0).open "select classid,classname from feilei where topclass=0",conn,1,3 
while not rs(0).eof   
	response.write "<option value='"&rs(0)("classid")&"'>"&rs(0)("classname")&"</option>"&vbCrLf   
	call listunder(1)   
	rs(0).movenext   
wend 
%>   
</select><br>  
其他信息:<input name="memo" size="50"><br>   
<input type="hidden" name="action" value="add">   
<input type="submit" value="添加新网站">   
</form>   
<br><br> 
</td> 
</tr> 
<tr>   
<td align="center" bgcolor="#eeeeee">[<font color="#002288"> <a href="http://www.baxun.com" target="_blank">八讯免费网</a></font>]</td>  
</tr>  
</table>  
</BODY>  
</HTML>