<!--#include file="byshop_conn.asp"-->
<!--#include file="session.asp"-->
<%
if request("action")="update" then
    for i=1 to request.form("id").count
	id=replace(request.form("id")(i),"'","")
	pic=replace(request.form("pic")(i),"'","")
	title=replace(request.form("title")(i),"'","")
	piclink=replace(request.form("piclink")(i),"'","")
	picorder=replace(request.form("picorder")(i),"'","")

conn.execute("update changepic set picorder='"&picorder&"', pic='"&pic&"',title='"&title&"',piclink='"&piclink&"' where id="&id)
next
conn.close
set conn=nothing
response.write "<meta http-equiv=""refresh"" content=""0;url=changepic.asp"">"
end if


if request("action")="add" then
	pic=trim(request("pic"))
	piclink=request.form("piclink")
	title=request.form("title")
		picorder=request.form("picorder")

Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "select * from changepic",conn,1,3
rs.addnew
rs("pic")=pic
rs("title")=title
rs("piclink")=piclink
rs("picorder")=picorder
rs.update
rs.close
set rs=nothing

conn.close
set conn=nothing
response.write "<meta http-equiv=""refresh"" content=""0;url=changepic.asp"">"
end if
%> 
  