
12/10/2004, 08:25
|
 | | | Fecha de Ingreso: mayo-2003 Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 22 años Puntos: 5 | |
listo aqui esta el codigo:
Código:
<%
DBPath = "usuarios.mdb"
Set Master = Server.CreateObject("ADODB.Connection")
Master.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(DBPath))
sw = request("sw")
usuario = request.Form("txtusuario")
password = request.Form("txtpassword")
existe = true
if sw = 1 then
sSQL = "select * from usuarios where us='" & usuario & "' and psw='" & password & "'"
set RSUsuarios = Master.Execute(sSQL)
if RSUsuarios.bof=false and RSUsuarios.eof=false then
select case RSUsuarios("perfil")
case "us_unificado"
session("perfil") = "us_unificado"
response.Redirect("pagina_de_unificado.asp")
case "us_admin"
session("perfil") = "us_admin"
response.Redirect("pagina_de_admin.asp")
case "us_pyme"
session("perfil") = "us_pyme"
response.Redirect("pagina_de_pyme.asp")
end select
else
existe = false
end if
end if
if existe = true then
%>
<form name="form1" method="post" action="login.asp?sw=1">
<table width="500" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td width="127">Usuario:</td>
<td width="359"><input type="text" name="txtusuario"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="text" name="txtpassword"></td>
</tr>
<tr>
<td height="44" colspan="2" align="center"><input type="submit" name="Submit" value="Entrar"></td>
</tr>
</table>
</form>
<%
else
%>
<table width="500" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">La combinación de Usuario y Passowrd es incorrecta. Por favor, intentelo nuevamente</td>
</tr>
</table>
<%
end if
%>
espero te sirva
__________________ Saruman One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them. |