ASP后台产品添加的问题,后台打开无任何显示。代码如下:
<!--#includefile="conn.asp"--><!--#includefile="seeion.asp"--><%Ifrequest("submit")="...
<!--#include file="conn.asp"-->
<!--#include file="seeion.asp"-->
<%
If request("submit") = "确定添加" Then
title = request.Form("title")
main_id = request.Form("main_id")
sub_id = request.Form("sub_id")
thumbnail = request.Form("thumbnail")
body = request.Form("body")
recommendatory = request.Form("recommendatory")
If title = "" Then
response.Write("<script language=javascript>alert('标题不能为空!');history.back(1)</script>")
response.End()
End If
If body = "" Then
response.Write("<script language=javascript>alert('内容不能为空!');history.back(1)</script>")
response.End()
End If
Set rs = server.CreateObject("adodb.recordset")
sql = "select * from products"
rs.Open sql, conn, 1, 3
rs.addnew
rs("title") = title
rs("main_id") = main_id
rs("sub_id") = sub_id
rs("thumbnail") = thumbnail
rs("body") = body
rs("recommendatory") = recommendatory
rs.update
rs.Close
Set rs = Nothing
Response.Write "<script>alert('成功添加产品,点击“确定”继续添加!');window.location.href='products.asp';</script>"
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>网站后台管理系统</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function showUploadDialog(s_Type, s_Link, s_Thumbnail){
var arr = showModalDialog("eWebEditor/dialog/i_upload.htm?style=popup&type="+s_Type+"&link="+s_Link+"&thumbnail="+s_Thumbnail, window, "dialogWidth:0px;dialogHeight:0px;help:no;scroll:no;status:no");}
</script>
<script language = "JavaScript">
<%
Set Rs = Server.CreateObject("Adodb.Recordset")
Rs.Open "SELECT * FROM products_category_sub ORDER BY sub_id", conn, 1, 1
%>
var onecount;
onecount=0;
subcat = new Array();
<%
i = 0
Do While Not Rs.EOF
%>
subcat[<%=i%>] = new Array("<%= Trim(Rs("sub_title"))%>","<%= Rs("main_id")%>","<%= Rs("sub_id")%>");
<%
i = i + 1
Rs.MoveNext
Loop
Rs.Close
%>
onecount=<%=i%>;
不完整代码在下面
%>
</select>
</td>
</tr>
<tr>
<td>产品缩略图:</td>
<td><input name="thumbnail" type="text" size="70"/>
<input type=button value="上传图片" onClick="showUploadDialog('image', 'cherry.thumbnail', '')"></td>
</tr>
<tr> </tr>
<tr>
<td height="258">内容详情:</td>
<td><textarea name="body" cols="" rows="" id="body" style="display:none"></textarea>
<IFRAME ID="eWebEditor1" SRC="ewebeditor/ewebeditor.htm?id=body&style=standard600" FRAMEBORDER="0" SCROLLING="no" WIDTH="98%" HEIGHT="400"></IFRAME></td>
</tr>
<tr>
<td>产品推荐:
不完整代码在下面 展开
<!--#include file="seeion.asp"-->
<%
If request("submit") = "确定添加" Then
title = request.Form("title")
main_id = request.Form("main_id")
sub_id = request.Form("sub_id")
thumbnail = request.Form("thumbnail")
body = request.Form("body")
recommendatory = request.Form("recommendatory")
If title = "" Then
response.Write("<script language=javascript>alert('标题不能为空!');history.back(1)</script>")
response.End()
End If
If body = "" Then
response.Write("<script language=javascript>alert('内容不能为空!');history.back(1)</script>")
response.End()
End If
Set rs = server.CreateObject("adodb.recordset")
sql = "select * from products"
rs.Open sql, conn, 1, 3
rs.addnew
rs("title") = title
rs("main_id") = main_id
rs("sub_id") = sub_id
rs("thumbnail") = thumbnail
rs("body") = body
rs("recommendatory") = recommendatory
rs.update
rs.Close
Set rs = Nothing
Response.Write "<script>alert('成功添加产品,点击“确定”继续添加!');window.location.href='products.asp';</script>"
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>网站后台管理系统</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function showUploadDialog(s_Type, s_Link, s_Thumbnail){
var arr = showModalDialog("eWebEditor/dialog/i_upload.htm?style=popup&type="+s_Type+"&link="+s_Link+"&thumbnail="+s_Thumbnail, window, "dialogWidth:0px;dialogHeight:0px;help:no;scroll:no;status:no");}
</script>
<script language = "JavaScript">
<%
Set Rs = Server.CreateObject("Adodb.Recordset")
Rs.Open "SELECT * FROM products_category_sub ORDER BY sub_id", conn, 1, 1
%>
var onecount;
onecount=0;
subcat = new Array();
<%
i = 0
Do While Not Rs.EOF
%>
subcat[<%=i%>] = new Array("<%= Trim(Rs("sub_title"))%>","<%= Rs("main_id")%>","<%= Rs("sub_id")%>");
<%
i = i + 1
Rs.MoveNext
Loop
Rs.Close
%>
onecount=<%=i%>;
不完整代码在下面
%>
</select>
</td>
</tr>
<tr>
<td>产品缩略图:</td>
<td><input name="thumbnail" type="text" size="70"/>
<input type=button value="上传图片" onClick="showUploadDialog('image', 'cherry.thumbnail', '')"></td>
</tr>
<tr> </tr>
<tr>
<td height="258">内容详情:</td>
<td><textarea name="body" cols="" rows="" id="body" style="display:none"></textarea>
<IFRAME ID="eWebEditor1" SRC="ewebeditor/ewebeditor.htm?id=body&style=standard600" FRAMEBORDER="0" SCROLLING="no" WIDTH="98%" HEIGHT="400"></IFRAME></td>
</tr>
<tr>
<td>产品推荐:
不完整代码在下面 展开
4个回答
展开全部
<!--#include file="conn.asp"-->
<!--#include file="seeion.asp"-->
<%
If request("submit") = "确定添加" Then
title = request.Form("title")
main_id = request.Form("main_id")
sub_id = request.Form("sub_id")
thumbnail = request.Form("thumbnail")
body = request.Form("body")
recommendatory = request.Form("recommendatory")
If title = "" Then
response.Write("<script language=javascript>alert('标题不能为空!');history.back(1)</script>")
response.End()
End If
If body = "" Then
response.Write("<script language=javascript>alert('内容不能为空!');history.back(1)</script>")
response.End()
End If
Set rs = server.CreateObject("adodb.recordset")
sql = "select * from products"
rs.Open sql, conn, 1, 3
rs.addnew
rs("title") = title
rs("main_id") = main_id
rs("sub_id") = sub_id
rs("thumbnail") = thumbnail
rs("body") = body
rs("recommendatory") = recommendatory
rs.update
rs.Close
Set rs = Nothing
Response.Write "<script>alert('成功添加产品,点击“确定”继续添加!');window.location.href='products.asp';</script>"
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>网站后台管理系统</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function showUploadDialog(s_Type, s_Link, s_Thumbnail){
var arr = showModalDialog("eWebEditor/dialog/i_upload.htm?style=popup&type="+s_Type+"&link="+s_Link+"&thumbnail="+s_Thumbnail, window, "dialogWidth:0px;dialogHeight:0px;help:no;scroll:no;status:no");}
</script>
<script language = "JavaScript">
<%
Set Rs = Server.CreateObject("Adodb.Recordset")
Rs.Open "SELECT * FROM products_category_sub ORDER BY sub_id", conn, 1, 1
%>
var onecount;
onecount=0;
subcat = new Array();
<%
i = 0
Do While Not Rs.EOF
%>
subcat[<%=i%>] = new Array("<%= Trim(Rs("sub_title"))%>","<%= Rs("main_id")%>","<%= Rs("sub_id")%>");
<%
i = i + 1
Rs.MoveNext
Loop
Rs.Close
%>
onecount=<%=i%>;
function changelocation(locationid,formname)
{
formname.sub_id.length = 0;
var locationid = locationid;
var i;
for (i = 0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
formname.sub_id.options[formname.sub_id.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
</head>
<body>
<!--#include file="header.asp"-->
<div id="top_banner" class="layout"></div>
<div id="content" class="layout">
<!--#include file="left.asp"-->
<div id="right">
<div class="right_title">
<h2>添加产品</h2>
</div>
<div class="right_body">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="table">
<form name="cherry" method="post" >
<tr>
<td width="14%">产品名称:</td>
<td width="86%"><input name="title" type="text" size="60" /></td>
</tr>
<tr>
<td>产品分类:</td>
<td><select name="main_id" id="main_id" onChange="changelocation(document.cherry.main_id.options[document.cherry.main_id.selectedIndex].value,document.cherry)">
<%
i = 0
Set rs = Conn.Execute("select * from products_category_main order by order_id")
Do While Not rs.EOF
If i = 0 Then main_id = rs(0)
Response.Write("<option value="""&rs(0)&""">"&rs(1)&"</option>")
i = i + 1
rs.movenext
Loop
rs.Close
Set rs = Nothing
%>
</select>
</td>
</tr>
<tr>
<td>产品缩略图:</td>
<td><input name="thumbnail" type="text" size="70"/>
<input type=button value="上传图片" onClick="showUploadDialog('image', 'cherry.thumbnail', '')"></td>
</tr>
<tr> </tr>
<tr>
<td height="258">内容详情:</td>
<td><textarea name="body" cols="" rows="" id="body" style="display:none"></textarea>
<IFRAME ID="eWebEditor1" SRC="ewebeditor/ewebeditor.htm?id=body&style=standard600" FRAMEBORDER="0" SCROLLING="no" WIDTH="98%" HEIGHT="400"></IFRAME></td>
</tr>
<tr>
<td>产品推荐:
<p> </p></td>
<td><input name="recommendatory" type="radio" value="1" />
推荐
<input name="recommendatory" type="radio" checked="checked" value="0" />
不推荐</td>
</tr>
<tr>
<td colspan="2"><p class="submit">
<input name="submit" type="submit" value="确定添加" />
</p></td>
</tr>
</form>
</table>
</div>
</div>
<div class="clear"></div>
</div>
<!--#include file="footer.asp"-->
这里是全代码,麻烦兄弟姐妹们帮忙看看。
<!--#include file="seeion.asp"-->
<%
If request("submit") = "确定添加" Then
title = request.Form("title")
main_id = request.Form("main_id")
sub_id = request.Form("sub_id")
thumbnail = request.Form("thumbnail")
body = request.Form("body")
recommendatory = request.Form("recommendatory")
If title = "" Then
response.Write("<script language=javascript>alert('标题不能为空!');history.back(1)</script>")
response.End()
End If
If body = "" Then
response.Write("<script language=javascript>alert('内容不能为空!');history.back(1)</script>")
response.End()
End If
Set rs = server.CreateObject("adodb.recordset")
sql = "select * from products"
rs.Open sql, conn, 1, 3
rs.addnew
rs("title") = title
rs("main_id") = main_id
rs("sub_id") = sub_id
rs("thumbnail") = thumbnail
rs("body") = body
rs("recommendatory") = recommendatory
rs.update
rs.Close
Set rs = Nothing
Response.Write "<script>alert('成功添加产品,点击“确定”继续添加!');window.location.href='products.asp';</script>"
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>网站后台管理系统</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function showUploadDialog(s_Type, s_Link, s_Thumbnail){
var arr = showModalDialog("eWebEditor/dialog/i_upload.htm?style=popup&type="+s_Type+"&link="+s_Link+"&thumbnail="+s_Thumbnail, window, "dialogWidth:0px;dialogHeight:0px;help:no;scroll:no;status:no");}
</script>
<script language = "JavaScript">
<%
Set Rs = Server.CreateObject("Adodb.Recordset")
Rs.Open "SELECT * FROM products_category_sub ORDER BY sub_id", conn, 1, 1
%>
var onecount;
onecount=0;
subcat = new Array();
<%
i = 0
Do While Not Rs.EOF
%>
subcat[<%=i%>] = new Array("<%= Trim(Rs("sub_title"))%>","<%= Rs("main_id")%>","<%= Rs("sub_id")%>");
<%
i = i + 1
Rs.MoveNext
Loop
Rs.Close
%>
onecount=<%=i%>;
function changelocation(locationid,formname)
{
formname.sub_id.length = 0;
var locationid = locationid;
var i;
for (i = 0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
formname.sub_id.options[formname.sub_id.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
</head>
<body>
<!--#include file="header.asp"-->
<div id="top_banner" class="layout"></div>
<div id="content" class="layout">
<!--#include file="left.asp"-->
<div id="right">
<div class="right_title">
<h2>添加产品</h2>
</div>
<div class="right_body">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="table">
<form name="cherry" method="post" >
<tr>
<td width="14%">产品名称:</td>
<td width="86%"><input name="title" type="text" size="60" /></td>
</tr>
<tr>
<td>产品分类:</td>
<td><select name="main_id" id="main_id" onChange="changelocation(document.cherry.main_id.options[document.cherry.main_id.selectedIndex].value,document.cherry)">
<%
i = 0
Set rs = Conn.Execute("select * from products_category_main order by order_id")
Do While Not rs.EOF
If i = 0 Then main_id = rs(0)
Response.Write("<option value="""&rs(0)&""">"&rs(1)&"</option>")
i = i + 1
rs.movenext
Loop
rs.Close
Set rs = Nothing
%>
</select>
</td>
</tr>
<tr>
<td>产品缩略图:</td>
<td><input name="thumbnail" type="text" size="70"/>
<input type=button value="上传图片" onClick="showUploadDialog('image', 'cherry.thumbnail', '')"></td>
</tr>
<tr> </tr>
<tr>
<td height="258">内容详情:</td>
<td><textarea name="body" cols="" rows="" id="body" style="display:none"></textarea>
<IFRAME ID="eWebEditor1" SRC="ewebeditor/ewebeditor.htm?id=body&style=standard600" FRAMEBORDER="0" SCROLLING="no" WIDTH="98%" HEIGHT="400"></IFRAME></td>
</tr>
<tr>
<td>产品推荐:
<p> </p></td>
<td><input name="recommendatory" type="radio" value="1" />
推荐
<input name="recommendatory" type="radio" checked="checked" value="0" />
不推荐</td>
</tr>
<tr>
<td colspan="2"><p class="submit">
<input name="submit" type="submit" value="确定添加" />
</p></td>
</tr>
</form>
</table>
</div>
</div>
<div class="clear"></div>
</div>
<!--#include file="footer.asp"-->
这里是全代码,麻烦兄弟姐妹们帮忙看看。
展开全部
把<form name="cherry" method="post" >改为:<form name="cherry" id="cherry" method="post" action="products.asp" >
把<input name="submit" type="submit" value="确定添加" />改为:<input name="addrs" id="addrs" type="submit" value="确定添加" />
把<input name="submit" type="submit" value="确定添加" />改为:<input name="addrs" id="addrs" type="submit" value="确定添加" />
追问
还是不行啊,
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2011-08-25
展开全部
看不出来什么,只有全部的源码在调试中才能知道是什么问题
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
还有代码放不下了啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询