在线购书系统的网络说明,asp编写的

源代码在线查看: savevote.asp

软件大小: 989 K
上传用户: awake2
关键词: asp 网络 编写
下载地址: 免注册下载 普通下载 VIP

相关代码

				
				
				
				
								if request("id")"del" then
				err=0
				title=request("title")
				if title="" then
				err=1
				error=error+"标题不能为空\n"
				end if
				a=0
				for i=1 to request("xz").count
				if request("xz")(i)="" then
				exit for
				end if
				a=a+1
				next
				if a=0 then
				err=1
				error=error+"选择内容不能为空\n"
				end if
				if err=1 then
				response.write "alert('"&error&"');"
				response.write "history.back(1);"
				response.end
				end if
				end if
				
				if request("id")="xg" then
				conn.execute("update class set title='"&title&"',style='"&request("style")&"' where id="&request("classid"))
				conn.execute("delete from vote where class="&request("classid"))
				for i=1 to request("xz").count
				if request("xz")(i)"" then
				conn.execute("insert into vote (vote,color,class) values ('"&request("xz")(i)&"','"&request("color")(i)&"',"&request("classid")&")")
				else
				exit for
				end if
				next
				response.write "alert('修改投票成功');"
				response.write "location.href='votelist.asp';"
				elseif request("id")="del" then
				conn.execute("delete from vote where class="&request("classid"))
				conn.execute("delete from class where id="&request("classid"))
				response.write "alert('删除投票成功');"
				response.write "location.href='votelist.asp';"
				else
				conn.execute("insert into class (title,style,ren) values ('"&title&"','"&request("style")&"','"&request.cookies("admin")&"')")
				set rs=server.createobject("adodb.recordset")
				sql="select top 1 * from class where title='"&title&"' order by id desc"
				rs.open sql,conn,3,1
				classid=rs("id")
				rs.close
				set rs=nothing
				for i=1 to request("xz").count
				if request("xz")(i)"" then
				conn.execute("insert into vote (vote,color,class) values ('"&request("xz")(i)&"','"&request("color")(i)&"',"&classid&")")
				else
				exit for
				end if
				next
				response.write "alert('添加投票成功');"
				response.write "location.href='step1.asp';"
				end if
				conn.close
				set conn=nothing
				%>			

相关资源