<!-- #include virtual = "/include/myopen.asp" -->
<%
	set RS = Server.CreateObject("ADODB.RecordSet")
	set RS1 = Server.CreateObject("ADODB.RecordSet")
%>
<%
IF Request.Form ("USER_NAME") <> "" AND Request.Form ("USER_PASS") <> "" THEN		
		SQL = "SELECT * FROM MEMBER WHERE USER_NAME = '" & Request.Form ("USER_NAME") & "' AND USER_PASS = '" & Request.Form ("USER_PASS") & "'"
		RS.Open SQL,CONN,adOpenKeyset ,adLockReadOnly
			IF RS.RecordCount >0 THEN
			'删除昨天的记录
			SQL = "DELETE FROM ORDER_TEMP WHERE ORDER_DATE <#" & DATE & "#"
			CONN.Execute (SQL)
			'删除的记录
			SQL = "DELETE FROM ORDER_TEMP WHERE USER_NAME = '" & Request.Form ("USER_NAME") & "'"
			CONN.Execute (SQL)
			'用户的密码合法 
			Response.Cookies ("USER_NAME") = Request.Form ("USER_NAME")
			Response.Cookies ("USER_PASS") = Request.Form ("USER_PASS")
			source_url = Request.Form ("source_url")
			IF source_url ="" THEN
			Response.Redirect ("/member/default.asp")
			ELSE
				IF REQUEST("ORDER") = "" THEN
				Response.Redirect source_url
				ELSE
				THE_URL= source_url & "?card_no=" & request("card_no") & "&card_name=" & request("card_name") & "&card_unit=" & request("card_unit") & "&card_price=" & request("card_price") & "&card_price_a=" & request("card_price_a") & "&number=" & request("number") & "&order=all&act=insert"
				Response.Redirect THE_URL
				END IF
			END IF
			ELSE
			Response.Redirect ("login.asp")
			END IF
		
	ELSE
	'用户输入的不完整
	Response.Redirect ("login.asp")
	END IF
%>