<% IF Request.QueryString("msg") = "true" THEN msg_erro = "

* Sessão expirada!

" End IF If Request.Form("exp") = "Enviar" Then Set objCon = Server.CreateObject("ADODB.Connection") objCon.Open strCon Set objRS = Server.CreateObject("ADODB.Recordset") objRS.CursorLocation = 3 objRS.CursorType = 3 objRS.LockType = 1 %> <% strQ = "SELECT * FROM clientes WHERE email LIKE '" & login & "' AND senha LIKE '" & senha & "'" objRS.Open strQ, objCon, , , &H0001 If Not objRS.EOF Then Session("adm") = login Session("ip_admin") = Request.ServerVariables("REMOTE_ADDR") Session("id_cliente") = objRS("id_cliente") Session("nomeUsuario") = objRS("nome") '################################################################################################################################## 'INFORMAÇÕES DE ACESSO E RETORNO DE LOG id_cliente = Session("id_cliente") ip = Session("ip_admin") Set LogCon = CreateObject("ADODB.Connection") LogCon.open strCon 'RETORNA O ÚLTIMO ACESSO DO USUÁRIO Set RSlog = Server.CreateObject("ADODB.Recordset") SqlLog = "SELECT * FROM clientes_log WHERE id_cliente="&id_cliente&" ORDER BY id_log DESC" RSlog.Open SqlLog, LogCon 'GRAVA ACESSO EM LOG LogCon.Execute("INSERT INTO clientes_log (id_cliente, data, ip) VALUES ('"&id_cliente&"', Now(), '"&ip&"')") '################################################################################################################################## Response.Redirect("pedidos.asp") Else msg_erro = "

* Login ou senha invalido(s)!

" End IF objRS.Close Set objRS = Nothing objCon.Close Set objCon = Nothing End IF %>

Efetuar Login

<%=msg_erro%>