⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 add_product.asp

📁 一个管理文件,能够进行各种功能
💻 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 + -