ASP代码问题,麻烦大家看一下什么问题!
<divalign="center"><center><tableborder="0"cellpadding="0"cellspacing="0"style="borde...
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="800">
<tr>
<td width="100" background="../gb/images/main/left.gif"> </td>
<td width="600" bgcolor="#ADBDB4">
<table width="600" border="0" cellspacing="0" cellpadding="5" class="xzy" align="center">
<tr>
<td bgcolor="#5E7567" width="583">管理选项:<a href="admin.asp">管理首页</a> | <a href="adminfile.asp">管理文件</a>
| <a href="loginout.asp">退出管理</a></td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="5" align="center" bgcolor="#FFFFFF">
<tr>
<td height="5" bgcolor="#ADBDB4"></td>
</tr>
<form name="form1" method="post" action="saveadmintype.asp?cz=addclass">
<tr>
<td class="bk" bgcolor="#ADBDB4">添加分类:
<input type="text" name="classname" class="an" size="15" maxlength="50">
<input type="submit" name="Submit" value="添加" class="an">
</td>
</tr>
</form>
<form name="form2" method="post" action="saveadmintype.asp">
<tr>
<td class="xzy" bgcolor="#ADBDB4">管理分类:
<select name="classid">
<%
添加分类实现不了,麻烦指教一下,谢谢!
<%
if Request.Form("cz")="" then
cz=Request.QueryString("cz")
else
cz=Request.Form("cz")
end if
if cz="addtype" or cz="editclass" then
if Request.Form("classname")="" then
Response.Redirect"info.asp?info=请填写分类名称"
end if
Set rs = Server.CreateObject("ADODB.Recordset")
if cz="editclass" then
sql = "SELECT * FROM type where id="&Request.Form("classid")
rs.OPEN sql,Conn,1,3
else
sql = "SELECT * FROM type where (id is null)"
rs.OPEN sql,Conn,1,3
rs.addnew
end if
rs("name")=Request.Form("classname")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.Redirect"admin.asp"
elseif cz="addtype" or cz="edittype" then
founderr=false
if trim(Request.Form("typename"))="" then
founderr=true
info=info+"<li>请填写分类名称</li>"
end if
if founderr=false then
Set rs = Server.CreateObject("ADODB.Recordset")
if cz<>"edittype" then
sql = "SELECT * FROM type where id="&Request.Form("classid")
rs.OPEN sql,Conn,1,3
else 展开
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="800">
<tr>
<td width="100" background="../gb/images/main/left.gif"> </td>
<td width="600" bgcolor="#ADBDB4">
<table width="600" border="0" cellspacing="0" cellpadding="5" class="xzy" align="center">
<tr>
<td bgcolor="#5E7567" width="583">管理选项:<a href="admin.asp">管理首页</a> | <a href="adminfile.asp">管理文件</a>
| <a href="loginout.asp">退出管理</a></td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="5" align="center" bgcolor="#FFFFFF">
<tr>
<td height="5" bgcolor="#ADBDB4"></td>
</tr>
<form name="form1" method="post" action="saveadmintype.asp?cz=addclass">
<tr>
<td class="bk" bgcolor="#ADBDB4">添加分类:
<input type="text" name="classname" class="an" size="15" maxlength="50">
<input type="submit" name="Submit" value="添加" class="an">
</td>
</tr>
</form>
<form name="form2" method="post" action="saveadmintype.asp">
<tr>
<td class="xzy" bgcolor="#ADBDB4">管理分类:
<select name="classid">
<%
添加分类实现不了,麻烦指教一下,谢谢!
<%
if Request.Form("cz")="" then
cz=Request.QueryString("cz")
else
cz=Request.Form("cz")
end if
if cz="addtype" or cz="editclass" then
if Request.Form("classname")="" then
Response.Redirect"info.asp?info=请填写分类名称"
end if
Set rs = Server.CreateObject("ADODB.Recordset")
if cz="editclass" then
sql = "SELECT * FROM type where id="&Request.Form("classid")
rs.OPEN sql,Conn,1,3
else
sql = "SELECT * FROM type where (id is null)"
rs.OPEN sql,Conn,1,3
rs.addnew
end if
rs("name")=Request.Form("classname")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.Redirect"admin.asp"
elseif cz="addtype" or cz="edittype" then
founderr=false
if trim(Request.Form("typename"))="" then
founderr=true
info=info+"<li>请填写分类名称</li>"
end if
if founderr=false then
Set rs = Server.CreateObject("ADODB.Recordset")
if cz<>"edittype" then
sql = "SELECT * FROM type where id="&Request.Form("classid")
rs.OPEN sql,Conn,1,3
else 展开
展开全部
<form name="form1" method="post" action="saveadmintype.asp?cz=addclass">
if cz="addtype" or cz="editclass" then
自己看下cz对应不对应,呵呵,新手问题我以前也经常碰到,既然使用method="post"了就不要用 QueryString了,直接在里面加多一个
<input type="hidden" name="cz" value="addclass">
if cz="addtype" or cz="editclass" then
自己看下cz对应不对应,呵呵,新手问题我以前也经常碰到,既然使用method="post"了就不要用 QueryString了,直接在里面加多一个
<input type="hidden" name="cz" value="addclass">
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询