Welcome to WebmasterWorld Guest from 18.206.194.83

Forum Moderators: ocean10000

Message Too Old, No Replies

My login page won't work - any help?

     
12:11 pm on Jun 4, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 11, 2009
posts:108
votes: 0


When I click 'login' so that I can login to my account using this page it does nothing. It starts 'working' as if it were connecting to the next page but nothing happens. The errors don't show up, the javascript doesn't show up. Nothing works on it for some reason. Can someone help me? The other asp pages work fine on the server so there's no issue there.

Code:

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/myDSN.asp" -->
<%
dim strMsg, userName, pass, hdnSaveValue

userName = Request.Form("username")
userName = replace(userName, "'", "''")
pass = Request.Form("password")
pass = replace(pass, "'", "''")
hdnSaveValue = Request.Form("hdnSaveValue")
strMsge=""
if(hdnSaveValue="1") then
sql = "SELECT * from Listngs WHERE Email = '" & userName & "' AND cPass = '" & pass & "'"
Set rsOuter = Server.CreateObject("ADODB.RecordSet")
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.open myDSN
counter = 0
rsOuter.Open sql,cnn,0,1
if NOT rsOuter.EOF then
session("User") = rsOuter("Email")
session("Pass") = rsOuter("cPass")
session("creche") = rsOuter("ID")
session("user") = rsOuter("cID")
response.redirect("logg.asp")
else
strMsg = "***Error: Invalid Username or password, Please retry***"
end if
end if

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My Form</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript">
function CheckValidForm()
{
var userName = document.getElementById("username");
var pass = document.getElementById("pass");
var hdnSaveValue = document.getElementById("hdnSaveValue");
hdnSaveValue.value="0";
var canPost = false;

if(userName.value=="")
{
alert("Please enter user name(valid email)");
userName.focus();
userName.select();
return false;
}
if(!checkEmail(userName))
return false;

if(pass.value=="")
{
alert("Please enter your password");
pass.focus();
pass.select();
return false;
}
else
canPost = true;

if(canPost)
{
hdnSaveValue.value="1";
document.frmLogin.submit();
}
}

</script>
</head>
<table width="95%" border="0" align="center" cellpadding="2" cellspacing="0">
<tr bgcolor="#FFFFFF">
<td valign="top" class="micrositeban">Please login to access your account </td>
</tr>
<tr>
<td valign="middle" bgcolor="#FFFFFF"><div align="center">
<p><br />
<%=strMsg %> </p>
<p>&nbsp; </p>
<form name="frmLogin" id="frmLogin" method="post">
<table width="300" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="50%">Username</td>
<td><input name="username" type="text" id="username" /></td>
</tr>
<tr>
<td>Password</td>
<td><input name="password" type="password" id="password" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input name="btnsubmit" id="btnsubmit" type="submit" onclick="return CheckValidForm();" value="Login here" />
<input type="hidden" id="hdnSaveValue" name="hdnSaveValue" /></td>
</tr>
</table>
</form>
<br />
</div></td>
</tr>
<tr>
<td valign="middle" bgcolor="#FFFFFF"><br />
</td>
</tr>
</table>
</body>
</html>
8:23 pm on June 7, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 11, 2009
posts:108
votes: 0


Hi,
Sorry I worked it out. I really am an idiot. Turns out the page it was redirecting to (logg.asp) was looking for a session that was empty so it was kicking back to login.asp instead of going to logg.asp. The page logg.asp required one of the sessions to contain something but it was empty. I posted this just in case someone has the same issue.

Thanks.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members