goods_ok.asp

来自「这是一个网上购物物网站,数据库的连接在CONN.ASP中,既有前台网站,也有后台」· ASP 代码 · 共 37 行

ASP
37
字号
<!--#include file="conn.asp"-->

<%
action=request("action")
if action="add" then       '添加数据
    set rs=server.createobject("adodb.recordset")
	rs.open "select * from newgoods",conn,3,2
	rs.addnew	
	 rs("username")=session("username")
    rs("name")=request.Form("name")
    rs("bigclass")=request.Form("bigclass")
	rs("scprice")=request.Form("scprice")
	rs("hyprice")=request.Form("hyprice")
	rs("img")=request.Form("img")
    rs("content")=request.Form("content")
    rs("addtime")=now()
	rs.update
	Response.Write("<script>alert('添加成功!');window.location='goods_add.asp';</script>")
	
elseif action="mdf" then   '修改数据
	set rs=server.createobject("adodb.recordset")
	rs.open"select bigclass,scprice,hyprice,content,addtime from newgoods where goodid=" &request("goodid"),conn,1,3
	rs("bigclass")=request.Form("biclass")
	rs("scprice")=request.Form("scprice")
	rs("hyprice")=request.Form("hyprice")
    rs("content")=request.Form("content")
    rs("addtime")=now()
	rs.update
	Response.Write("<script>alert('修改成功!');window.location='goods_list.asp';</script>")
	
	
elseif action="del" then   '删除数据
	sql="delete from newgoods where goodid=" &request("goodid")
    set rs=conn.execute(sql)
	Response.Write("<script>alert('删除成功!');window.location='goods_list.asp';</script>")
end if
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?