主题:高手帮忙看看,老是出现缺少对象.
<%@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" -->
<!--#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" -->