<% verify = Request("verify") %> <% mess = "Login to Administer Site" %> <% if verify = "yes" then %> <% Response.Cookies("willeyprintingadmin") = Request.ServerVariables("REMOTE_ADDR")&"-"&CDbl(NOW) %> <% Response.Cookies("willeyprintingadmin").Path = "/" %> <% cookie_id = Request.Cookies("willeyprintingadmin") %> <% username = Request("username") %> <% password = Request("password") %> <% Set Conn = Server.CreateObject("ADODB.Connection") %> <% Conn.Mode = 3 %> <% Conn.Open "Driver={MySQL};Server=megasqlservers.com;DATABASE=willeymain_willeyprinting_com;" & _ "UID=dbm.willeyprinting.com;PWD=print4pay;"%> <% SQL = "SELECT * FROM adminusers WHERE ucase(u_username)=ucase('"&username&"')" Set rstValidate = Server.CreateObject("ADODB.Recordset") rstValidate.open SQL, Conn if rstValidate.EOF then member_ok = 0 else member_ok = -1 end if if member_ok then rstValidate.MoveFirst if password = trim(rstValidate("u_password")) then SQL = "UPDATE adminusers SET cookie_id = '"&cookie_id&"' WHERE ucase(u_username) = ucase('"&username&"')" Conn.Execute SQL Conn.Close response.Redirect "main.asp" else ' incorrect password --> mess = "Sorry that password is incorrect" end if else 'The username isn't there --> mess = "Sorry the username '"&username&"' is not in our system." end if rstValidate.Close Conn.Close %> <% end if %> Willey Printing: Administration Login
Willey Printing
Administration Login
<%= mess %>
Username:  
Password: