ASP网站后台新闻添加不能用 帮忙看下代码
<%Ifrequest.Form("submit")="确认添加"ThenIfrequest.Form("pf_news_name")=""ThenCallinfobac...
<%
If request.Form("submit") = "确认添加" Then
If request.Form("pf_news_name") = "" Then
Call infoback("新闻名称不能为空!")
End If
If request.Form("pf_news_order") = "" Or Not IsNumeric(request.Form("pf_news_order")) Then
Call infoback("排序数字不能为空,且必须为数字!")
End If
If request.Form("pf_news_content") = "" Then
Call infoback("详细介绍不能为空!")
End If
Set rs = server.CreateObject("adodb.recordset")
sql = "select * from pf_news "
rs.Open sql, conn, 1, 3
rs.addnew
rs("pf_news_name") = request.Form("pf_news_name")
rs("pf_news_order") = request.Form("pf_news_order")
rs("pf_news_sources") = request.Form("pf_news_sources")
rs("pf_news_author") = request.Form("pf_news_author")
rs("pf_news_category") = request.Form("pf_news_category")
rs("pf_news_keywords") = request.Form("pf_news_keywords")
rs("pf_news_content") = request.Form("pf_news_content")
rs.update
Call close_rs
Call close_conn
Call infohref("新闻添加成功!", "pf_news_add.asp")
End If
%>
那里有错 请指点 展开
If request.Form("submit") = "确认添加" Then
If request.Form("pf_news_name") = "" Then
Call infoback("新闻名称不能为空!")
End If
If request.Form("pf_news_order") = "" Or Not IsNumeric(request.Form("pf_news_order")) Then
Call infoback("排序数字不能为空,且必须为数字!")
End If
If request.Form("pf_news_content") = "" Then
Call infoback("详细介绍不能为空!")
End If
Set rs = server.CreateObject("adodb.recordset")
sql = "select * from pf_news "
rs.Open sql, conn, 1, 3
rs.addnew
rs("pf_news_name") = request.Form("pf_news_name")
rs("pf_news_order") = request.Form("pf_news_order")
rs("pf_news_sources") = request.Form("pf_news_sources")
rs("pf_news_author") = request.Form("pf_news_author")
rs("pf_news_category") = request.Form("pf_news_category")
rs("pf_news_keywords") = request.Form("pf_news_keywords")
rs("pf_news_content") = request.Form("pf_news_content")
rs.update
Call close_rs
Call close_conn
Call infohref("新闻添加成功!", "pf_news_add.asp")
End If
%>
那里有错 请指点 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询