Ver Mensaje Individual
  #6 (permalink)  
Antiguo 23/03/2007, 17:57
Avatar de Shiryu_Libra
Shiryu_Libra
Colaborador
 
Fecha de Ingreso: febrero-2007
Ubicación: Cantando "Screenager" en "Kirafa Kaput"
Mensajes: 3.614
Antigüedad: 18 años, 1 mes
Puntos: 88
Re: como evitar iniciar session tipo FDW

compañeros, podrian evaluarme, creo que ustedes entenderian mas...

Código:
<%
DIM contador, ip_visitante, hora, usuario, clave

StrCxn="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
StrCxn=StrCxn & "c:\empiezo\sitios\Gestion\utilerias\gestion.mdb;"
set cxn=server.CreateObject("ADODB.Connection")
set RS=server.CreateObject("ADODB.Recordset")
cxn.open StrCxn

Function Entrar()
SQL="select nombre,pass from ValidUsers where id_user='"&usuario&"';"
RS.OPEN SQL, cxn, 3, 3
if Err=0 then
    if RS.EOF=FALSE then
        if clave=RS("pass").value then 
            response.Write "Bienvenido de Regreso "&RS("nombre").value
        else
            response.Write "Contraseña Incorrecta, Intente nuevamente"
            contador=contador+1
            sSQL="insert into intentos (ip_visitante, hora, intentos) values ('"&ip_visitante&"', "&hora&", "&contador&");"
            cxn.execute(sSQL)
        end if
    else
        response.Write "Nombre de Usuario Incorrecto"
    end if
end if
RS.close
end function

function verificar(ip)
SQL="select ip_visitante, hora, intento FROM intentos where ip_visitante="&ip&" ;"
RS.open SQL, cxn, 3, 3
if Err=o then
    if RS.EOF=true then
        acceso=1
    else
        if RS("intento").value<3 then
            entrar()
        else
            accesso=0
        end if
    end if
end if
RS.close
end function

if request.QueryString("ingresar")="ahorita" then
ip_visitante=request.ServerVariables("REMOTE_ADDR")
hora=hour(now)&minute(now)&second(now)
usuario=request.Form("Usuario")
clave=request.Form("Password")

verificar(ip)
end if

cxn.close
set cxn=nothing
set RS=nothing
%>