注册 登录
编程论坛 ASP技术论坛

asp错误新手求帮助。请大家说说这个是什么错误,是服务器问题还是代码问题。

qq329684750 发布于 2012-08-05 10:01, 969 次点击
下载了一套ASP源码来研究,但是发现登录后发布产品 无法发布,求帮助谢谢了!。请大家说说这个是什么错误,是服务器问题还是代码问题。
地址是:troupe.   用户名admin  密码 admin     登录后发布 无法发布  。提示Response.ContentType = "text/html" Response.CharSet = "GB2312"
Microsoft VBScript 运行时错误 错误 '800a01b6'

对象不支持此属性或方法: 'Server.ubbcode'

/admin/adminsave.asp,行 58
程序代码:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
Response.ContentType = "text/html"
Response.CharSet = "GB2312"

<!--#include file="conn.asp"-->
<%
      
if session("admin")="" then
          response.redirect
"admin.asp"
      
end if
%>
<!--#include file="char.asp"-->
<%
   
dim rs,sql
   
dim title
   
dim content
   
dim productid
   
dim classid,Nclassid
   
dim Nkey
   
dim price
   
dim images
   
dim state
   
dim errmsg
   
dim recommend
   
dim founderr
    founderr
=false
   
if trim(request.form("txttitle"))="" then
          founderr
=true
          errmsg
="<li>产品标题不能为空</li>"
   
end if
   
if trim(request.form("txtcontent"))="" then
          founderr
=true
          errmsg
=errmsg+"<li>产品内容不能为空</li>"
   
end if
   
if trim(request.form("key"))="" then
          founderr
=true
          errmsg
=errmsg+"<li>请输入产品关键字</li>"
   
end if
   
if trim(request.form("classid"))="" then
          founderr
=true
          errmsg
=errmsg+"<li>产品分类不能为空</li>"
   
end if
   
if trim(request.form("Nclassid"))="" then
          founderr
=true
          errmsg
=errmsg+"<li>产品专题不能为空</li>"
   
end if
   
if founderr=false then
        title
=server.htmlencode(request.form("txttitle"))
        Nkey
=server.htmlencode(trim(request.form("key")))
        classid
=request.form("classid")
        Nclassid
=request.form("Nclassid")
        images
=request.form("images")
        recommend
=request.form("recommend")
        
if request("htmlable")="yes" then
        content
=server.htmlencode(request("txtcontent"))
        
else
        content
=server.ubbcode(request.form("txtcontent"))
        
end if
   
set rs=server.createobject("adodb.recordset")
   
if request("action")="add" then
        
call newsoft()
   
elseif request("action")="edit" then
        
call editsoft()
   
else
        founderr
=true
        errmsg
=errmsg+"<li>没有选定参数</li>"
   
end if
sub newsoft()
    sql
="select * from product where (productid is null)"
    rs.open sql,conn,
1,3
    rs.addnew
    rs(
"title")=title
    rs(
"content")=content
    rs(
"Nclassid")=Nclassid
    rs(
"classid")=classid
    rs(
"images")=images
    rs(
"Nkey")=Nkey
    rs(
"recommend")=recommend
    rs(
"hits")=0
   
if request.form("price")<>"" then
        rs(
"price")=trim(request.form("price"))
   
end if
        
if request.form("recommend")="1" then
    recommend
=1
   
else
    recommend
=2
   
end if
   
if request.form("state")<>"" then
        rs(
"state")=trim(request.form("state"))
   
end if
    rs(
"dateandtime")=date()
    rs.update
    productid
=rs("productid")
end sub
sub editsoft()
    sql
="select * from product where productid="&request("id")
    rs.open sql,conn,
1,3
    rs(
"title")=title
    rs(
"content")=content
    rs(
"Nclassid")=Nclassid
    rs(
"classid")=classid
    rs(
"images")=images
    rs(
"Nkey")=Nkey
   
if request.form("recommend")="1" then
    recommend
=1
   
else
    recommend
=2
   
end if
   
if request.form("price")<>"" then
        rs(
"price")=trim(request.form("price"))
   
end if
   
if request.form("state")<>"" then
        rs(
"state")=trim(request.form("state"))
   
end if
    rs.update
    productid
=rs("productid")
end sub
    rs.close
   
set rs=nothing
    conn.close
   
set conn=nothing
%>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="../include/STYLE.CSS">
</head>
<body>
<div align="center"><center>
<br><br>
<table class="border" align=center width="50%" border="0" cellpadding="4" cellspacing="0" bordercolor="#999999">
  <tr align=center>
    <td width="100%" class="title"  height="20"><b>
<%if request("action")="add" then%>添加<%else%>修改<%end if%>产品成功</b></td>
  </tr>
  <tr>
    <td class="tdbg"><p align="left"><br>
        产品序号为:<%response.write "product"&productid%><br>
        产品名称为:<%response.write title%></p>
    您可以进行其他操作
    </td>
  </tr>
</table>
</center></div>
<%
else
   
Error()
end if
%>
</body>
</html>
<%
sub Error()
    response.write
"   <html><head><link rel='stylesheet' href='/include/STYLE.CSS'></head><body>"
        response.write
"   <br><br><br>"
        response.write
"    <table align='center' width='300' border='0' cellpadding='4' cellspacing='0' class='border'>"
        response.write
"      <tr > "
        response.write
"        <td class='title' colspan='2' height='15'> "
        response.write
"          <div align='center'>由于以下的原因不能保存数据!</div>"
        response.write
"        </td>"
        response.write
"      </tr>"
        response.write
"      <tr> "
        response.write
"        <td align=center class='tdbg' colspan='2' height='23'> "
        response.write
"          <br>"
        response.write errmsg
& " <br><br>"
        response.write
"        <a href='javascript:onclick=history.go(-1)'>返回</a>"      
        response.write
"        <br><br></td>"
        response.write
"      </tr>   </table></body></html>"
end sub
%>
此文件的代码是  58行是  content=server.ubbcode(request.form("txtcontent"))
,谢谢各位大神来看看。。。。


[ 本帖最后由 qq329684750 于 2012-8-5 10:28 编辑 ]
5 回复
#2
qq3296847502012-08-05 10:05
我感觉是字出问题了 GB2312
#3
aspic2012-08-06 10:55
程序代码:

<%
Response.ContentType
= "text/html"
Response.CharSet
= "GB2312"
%>
#4
netlin2012-08-09 13:30
网站的运行环境与网站代码不兼容。
请详细了解下载代码的使用说明。
#5
ysf01812012-08-11 15:19
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
Response.ContentType = "text/html"
Response.CharSet = "GB2312"


重复了。

#6
xmlz2012-08-12 21:05
以下是引用aspic在2012-8-6 10:55:06的发言:


<%
Response.ContentType = "text/html"
Response.CharSet = "GB2312"
%>


应该是这个吧
1