Ver Mensaje Individual
  #6 (permalink)  
Antiguo 29/05/2004, 15:43
Avatar de HPNeo
HPNeo
 
Fecha de Ingreso: mayo-2004
Ubicación: The Matrix
Mensajes: 223
Antigüedad: 20 años, 11 meses
Puntos: 0
Ok, aqui va:
<%
Dim login, clave, oConn, RS
Dim gry, rav, huf, sly, g, r, h, s, I

gry="images/png/gry.png"
rav="images/png/rav.png"
huf="images/png/huf.png"
sly="images/png/sly.png"

g="Gryffindor"
r="Ravenclaw"
h="Hufflepuff"
s="Slytherin"

If Request.Form("login") = "" OR Request.Form("clave") = "" then
Response.Redirect "hogwarts.asp"
Else
login = Trim(Request.Form("login"))
clave = Trim(Request.Form("clave"))
login = Replace(login,"'","''")
clave = Replace(clave,"'","''")

Set oConn = Server.CreateObject ("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& Server.MapPath("database/lodhp.mdb")

sql = "SELECT * FROM Alumnos WHERE Nick = '"& login &"'"
Set RS = Server.CreateObject ("ADODB.RecordSet")
RS.Open sql, oConn

If (RS.EOF = true) then
Response.Write "Ese usuario no existe"
ElseIf RS.Fields("Clave") = clave then
Bienvenido <B>"& login &"</B>"
Else
Response.Write "Esa contraseña no concuerda con el usuario ingresado"
End If

If (RS.Fields("Casa") = g then
I=gry
ElseIf RS.Fields("Casa") = r then
I=rav
ElseIf RS.Fields("Casa") = h then
I=huf
Else RS.Fields("Casa") = s then
I=sly
End If

RS.Close
oConn.Close
Set RS = Nothing
Set oConn = Nothing
End If
%>

<img src="<%= I %>" width="152" height="181" border="0" align="top">
__________________
HPNeo