
17/01/2006, 09:35
|
 | | | Fecha de Ingreso: diciembre-2005
Mensajes: 13
Antigüedad: 19 años, 4 meses Puntos: 0 | |
acá ta el código bueno este es el codigo por favor me dices en donde va esa funcion para que funcione. GRACIAS
<div id="Layer1" style="position:absolute; left:139px; top:9px; width:745px; height:102px; z-index:1"><img src="UC/banner_superior_azul_facea.JPG" width="751" height="103"></div>
<form action="login.asp" method="POST" name="isn">
<p> </p>
<p> </p>
<p> </p>
<p align="center"> </p>
<p align="center"><%=request.querystring("msg")%></p>
<div align="center">
<center>
<table border="0" width="48%" bgcolor="#F2F2F2">
<tr bgcolor="#000099">
<td colspan="2">
<p align="center"><font color="#FFFFFF"><strong>VERIFICACIÓN
DE ACCESO</strong></font></td>
</tr>
<tr>
<td width="23%"><strong>USUARIO:</strong></td>
<td width="77%"><input type="text" name="apellido" size="20">
<strong> Ejemplo: Caamaño</strong></td>
</tr>
<tr>
<td width="23%"><strong>PASSWORD: </strong></td>
<td width="77%"> <input type="password" name="rut" size="20">
<strong>Formato rut: xx.xxx.xxx-x</strong></td>
</tr>
<tr>
<td colspan="2">
<p align="center"><input type="submit" value="Entrar" name="B1"></td>
</tr>
</table>
</center>
</div>
</form>
<%else
'eliminamos las posibles comillas de la entrada
'para evitar la introducción de sentencias SQL
apellido=replace(request.form("apellido"),"'","")
rut=replace(request.form("rut"),"'","")
'Ponemos la primera letra en mayusculas
'apellido=ucase(mid(request.form("apellido"),1,1))
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\prueba\reservas.mdb"))
set rs = CreateObject("ADODB.Recordset")
sqltxt="Select * from profesor where apellido='"&apellido&"' and rut= '"&rut&"'"
'response.write sqltxt
rs.Open sqltxt, conn
if not rs.eof then
' nos ha devuelto un registro, ahora miraremos si es valido
' con ello evitamos el ataque típico SQL
if rs("apellido")=apellido and rs("rut")=rut then
' si el usuario esta en la base de datos y la password coincide
session("autorizacion")=1
Response.Cookies("apellido") = Request.Form("apellido")
response.redirect "default.asp"
'response.Write("ingrese inicial de su apellido con MAYUSCULA!!")
end if
else
session("autorizacion")=-1
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
if session("autorizacion")=-1 or session("autorizacion")="" then
' no hemos encontrado el registro
' eso indica que el usuario y/o la password son erroneos
response.redirect "login.asp?msg=Usuario%20o%20password%20incorrecta "
end if
end if%> |