回 帖 发 新 帖 刷新版面

主题:高手帮忙看看,老是出现缺少对象.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<!--#include file="Open.asp" -->
<!--#include file="upload.inc" -->


<%    on Error resume next
    response.buffer=true
    set upload=new upload_5xSoft 
    title=upload.form("title")
    content=upload.form("content")
    pro_name=upload.form("pro_name")
    temp=upload.form("temp")
    set image=upload.file("img")     
  
    imgname1=image.filename 

    if image.filename<>"" then
        imgname=getfilename(image.filename)
        image.SaveAs Server.MapPath("img/"&imgname)
    end if 
    
    if imgname1<>"" then
        SQL="insert into product(pro_name,title,content,img,pub_date)Values('"&pro_name&"','"&title&"','"&content&"','"&imgname&"','"&date&"')"
        else
        SQL="insert into product(pro_name,title,content,pub_date)Values('"&pro_name&"','"&title&"','"&content&"','"&date&"')"
    end if
    con.Execute SQL
    function getfilename(imgname)
        getfilename=replace(replace(replace(cstr(now)," ",""),"-",""),":","")&radm()&right(imgname,4)
    end function
    if err.number<>0 then
        Response.Write(err.Description)
        else
        Response.Write("<center>信息已经添加成功!<a href='javascript:close()'>关闭窗口</a></center>")
    end if
    
%>
<script language="JScript" runat="server">
function radm()
{
    return Math.round(Math.random()*100)
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>

</body>
</html>
<!--#include file="close.asp" -->


回复列表 (共2个回复)

沙发

运行结果是什么,把提示有错的行数显示部分写上,

板凳

只提示了几个字"缺少对象"其他没有

我来回复

您尚未登录,请登录后再回复。点此登录或注册