If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Need Help With A Login Page

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-04-04, 21:37
KlansMan KlansMan is offline
Registered User
 
Join Date: Apr 2004
Posts: 50
Need Help With A Login Page

Hi There I Need Some Help With A 3 Try login Page

When I've Tried To Login To My Appliction It Keeps Coming Up Page Not Found But The Pages Are There It Does The Same When I've Tried Testing The Invalid Password Part Of The Page As Well

MY Pages

Login.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Index</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
function IEINFOWINDOW ()
{
var putout ="SAS-MIBA Designed By DeV!L'$ @Dv()c@tE";
{
window.status = putout;
}
}
IEINFOWINDOW ()
</script>
<style type="text/css">
<!--
@import url(Css/NavButtons.css);
@import url(Css/Text.css);
-->
</style>
</head>

<body background="Image/Background.jpg">

<div id="Layer1" style="position:absolute; left:0px; top:0px; width:1024px; height:76px; z-index:1; background-color: #000000; layer-background-color: #000000; border: 1px none #000000;">
<table width="100%" height="80" border="0" cellpadding="1" cellspacing="1" bordercolor="#666666">
<tr>
<td class="Heading">sas-miba</td>
</tr>
</table>
</div>

<div id="Layer2" style="position:absolute; left:0px; top:80px; width:1024px; height:21px; z-index:2">
<table width="100%" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" class="button">
<tr>
<td width="13%"><div align="left"><font color="#FFFFFF">.</font></div></td>
<td width="20%"><div align="left"></div></td>
<td width="20%"><div align="left"></div></td>
<td width="15%"><div align="left"></div></td>
<td width="15%"><div align="left"></div></td>
<td width="17%"><div align="left"></div></td>
</tr>
</table>
</div>
<div id="Layer3" style="position:absolute; left:258px; top:316px; width:379px; height:115px; z-index:3">
<form name="form1" action="CheckLogin.asp<% If Request ("Second") = True Then
Response.Write"?Second =True"
ElseIf Request ("Second") = False AND Request ("Third") = True Then
Response.Write"?Third =True" %><% End If %> method="post" >
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td width="45%" class="FormText">NGT ID:</td>
<td width="55%"><input name="UserID" type="text" id="UserID" size="33"></td>
</tr>
<tr>
<td class="FormText">Password:</td>
<td><input name="Password" type="password" id="Password" size="33"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><div align="right">
<input type="reset" name="Reset" value="Reset ">
<input type="submit" name="Submit2" value="Login">
</div></td>
</tr>
</table>
</form>
</div>
<div id="Layer4" style="position:absolute; left:0px; top:161px; width:1024px; height:39px; z-index:4" class="Title">SAS-MIBa
Login</div>
<div id="Layer5" style="position:absolute; left:0px; top:218px; width:1024px; height:32px; z-index:5" class="Title">
<p>
<%
If Request ("Second") ="True" Then
IF Request ("WrongPW") ="True" Then
Response.Write "Your Password Was Invalid Please try again"
ElseIf Request ("Second")="False" AND Request ("Third") ="True"Then
IF Request ("WrongPW") = "True" Then
Response.Write "Your Password Was Invalid" & _
"If You Enter an invalid password again your account will be suspened"
End If
End If
End If
Response.Write "Please Enter Your NGT ID And Password Below"
%>
</p>
</div>
</body>
</html>


CheckLogin.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!-- #INCLUDE FILE ="DBconnection.asp" -->
<%
Dim strUserID, strPassword
strUserID = Request.Form ("UserID")
strPassword = Request.Form ("Password")

Dim rsUser
set rsUser = Server.CreateObject ("ADODB.Recordset")
strSQL ="SELECT * FROM tbl_RegForm WHERE UserID = '" & strUserID & "';"
rsUser.Open strSQL, objConn

If rsUser.EOF Then
Session ("UserID") = Request ("UserID")
If Request ("Second") = True Then
Response.Redirect "Login.asp?Third=True"
ElseIf Request ("second") = False And Request ("Third") = True Then
Response.Redirect "LockOut.asp"
Else
Response.Redirect "Login.asp?Second=True"
End If
End If
Else
While Not rsUser.EOF
If UCase (rsUser("Password")) = UCase (strPassword) Then
For Each strField In rsUser.Fields
strName = strField.Name
strValue = strField.Value
Session (strName) = strValue
Next
Session ("blnValidUser") = True
Response.Redirect "AccessType.asp"
Else
rsUser.MoveNext
End If
Wend
Session ("UserID") = Request("UserID")
If Request ("Second") ="True" Then
Response.Redirect "Login.asp?Third&WrongPW=True"
ElseIf Request ("Second") = False And Request ("Third") = True Then
Response.Redirect "LockOut.asp"
Else
Response.Redirect "Login.asp?Second&WrongPW=True"
End IF
End If
%>

I Hope Some one Can Help Me I've Been Racking my Brain Over This For Ages
See Am Fairy New To ASP And this Has Beaten Me

Cheers

KM
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On