?? add_product.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="checkadmin.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:history.back(-1)'>繼續添加</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>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
color: #000000;
}
a {
font-size: 12px;
color: #000000;
}
a:visited {
color: #000000;
}
-->
</style></head>
<body>
</body>
</html>
<!--#include file="close.asp" -->
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -