kurarensu
11-09-2006, 02:32 PM
hi, i hope u guys cld help me out. i have done this login page and i need to do some validation. but i added some/code some but none seems to work.. anyone willing to help me? i need the validation on my registration page as well. i'm making a cinema website for my project actually, and i wld like to knoe how to make the seatings? pls help asap..! thx
Here's my login page code:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connnew.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("txtusername"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="showing.asp"
MM_redirectLoginFailed="loginfail.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_connnew_STRING
MM_rsUser.Source = "SELECT Username, Password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM register WHERE Username='" & Replace(MM_valUsername,"'","''") &"' AND Password='" & Replace(Request.Form("txtpassword"),"'","''") & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<HTML>
<HEAD>
<TITLE>: xEnO :</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css" type="text/css">
<BASE TARGET="_self">
<style type="text/css">
<!--
body {
background-image: url(images/login.gif);
background-repeat: no-repeat;
}
#Layer2 {
position:absolute;
width:53px;
height:37px;
z-index:1;
left: 362px;
top: 81px;
}
#Layer1 {
position:absolute;
width:164px;
height:112px;
z-index:2;
left: 315px;
top: 31px;
}
#Layer3 {
position:absolute;
width:162px;
height:105px;
z-index:2;
left: 321px;
top: 51px;
}
#Layer4 {
position:absolute;
width:353px;
height:47px;
z-index:2;
left: 228px;
top: 173px;
}
#Layer5 {
position:absolute;
width:94px;
height:19px;
z-index:3;
left: 384px;
top: 82px;
}
#Layer6 {
position:absolute;
width:94px;
height:19px;
z-index:1;
left: -117px;
top: -46px;
}
#Layer7 {
position:absolute;
width:96px;
height:20px;
z-index:4;
left: 384px;
top: 107px;
}
#Layer8 {
position:absolute;
width:50px;
height:23px;
z-index:5;
left: 384px;
top: 126px;
}
-->
</style></HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<form ACTION="<%=MM_LoginAction%>" name="frmLogin" method="POST">
<div id="Layer8">
<input name="btnLogin" type="submit" value="Login" target="_self">
</div>
<div id="Layer5">
<input name="txtusername" type="text" size="19" maxlength="20" height="12" class="style3">
</div>
<div id="Layer7">
<input name="txtpassword" type="password" size="19" maxlength="20" height="12" class="style3">
</div>
<div id="Layer4">
<p align="center">Please login using your given Username & Password.</p>
<p align="center">If you do not have a username, please click <strong><a href="register.asp" target="MainFrame" class="style1">here</a></strong> to register.</p>
</div>
</form>
</BODY>
</HTML>
Here's my login page code:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connnew.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("txtusername"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="showing.asp"
MM_redirectLoginFailed="loginfail.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_connnew_STRING
MM_rsUser.Source = "SELECT Username, Password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM register WHERE Username='" & Replace(MM_valUsername,"'","''") &"' AND Password='" & Replace(Request.Form("txtpassword"),"'","''") & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<HTML>
<HEAD>
<TITLE>: xEnO :</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css" type="text/css">
<BASE TARGET="_self">
<style type="text/css">
<!--
body {
background-image: url(images/login.gif);
background-repeat: no-repeat;
}
#Layer2 {
position:absolute;
width:53px;
height:37px;
z-index:1;
left: 362px;
top: 81px;
}
#Layer1 {
position:absolute;
width:164px;
height:112px;
z-index:2;
left: 315px;
top: 31px;
}
#Layer3 {
position:absolute;
width:162px;
height:105px;
z-index:2;
left: 321px;
top: 51px;
}
#Layer4 {
position:absolute;
width:353px;
height:47px;
z-index:2;
left: 228px;
top: 173px;
}
#Layer5 {
position:absolute;
width:94px;
height:19px;
z-index:3;
left: 384px;
top: 82px;
}
#Layer6 {
position:absolute;
width:94px;
height:19px;
z-index:1;
left: -117px;
top: -46px;
}
#Layer7 {
position:absolute;
width:96px;
height:20px;
z-index:4;
left: 384px;
top: 107px;
}
#Layer8 {
position:absolute;
width:50px;
height:23px;
z-index:5;
left: 384px;
top: 126px;
}
-->
</style></HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<form ACTION="<%=MM_LoginAction%>" name="frmLogin" method="POST">
<div id="Layer8">
<input name="btnLogin" type="submit" value="Login" target="_self">
</div>
<div id="Layer5">
<input name="txtusername" type="text" size="19" maxlength="20" height="12" class="style3">
</div>
<div id="Layer7">
<input name="txtpassword" type="password" size="19" maxlength="20" height="12" class="style3">
</div>
<div id="Layer4">
<p align="center">Please login using your given Username & Password.</p>
<p align="center">If you do not have a username, please click <strong><a href="register.asp" target="MainFrame" class="style1">here</a></strong> to register.</p>
</div>
</form>
</BODY>
</HTML>