Forums
This topic is locked
"BOF or EOF are true" error on login
Posted 17 Aug 2005 05:03:22
1
has voted
17 Aug 2005 05:03:22 peter mill posted:
Hi I am have great difficulty getting my login page to work correctly it keeps producing an error "either BOF or EOF are True"
I am using IIS5 and Dreamweaver MX Access Database.
Here is my login page code
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/MyDatabase.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL"
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
MM_valUsername=CStr(Request.Form("UserLogin"
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="UserDetails.asp"
MM_redirectLoginFailed="Login-Error.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_MyDatabase_STRING
MM_rsUser.Source = "SELECT UserID, UserName, Password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM Users WHERE UserName='" & Replace(MM_valUsername,"'","''"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If MM_rsUser.EOF Or MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username"
Session("MM_UserID"
If (MM_fldUserAuthorization <> ""
Session("MM_UserAuthorization"
Else
Session("MM_UserAuthorization"
End If
if CStr(Request.QueryString("accessdenied"
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>User Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="99%" border="0">
<tr>
<td><div align="center"><font size="6" face="Arial, Helvetica, sans-serif">User Login</font></div></td>
</tr>
</table>
<br>
<form ACTION="<%=MM_LoginAction%>" method="POST" name="Login" id="Login">
<div align="center">
<table width="75%" border="0">
<tr>
<td bgcolor="#FFFF97"> <div align="center"><font color="#0000A0" face="Arial, Helvetica, sans-serif"><strong>Please
use your username and password to login. If you are not currently
a member you can register by clicking on the register link.</strong></font></div></td>
</tr>
</table>
<table width="51%" border="0" align="center" bgcolor="#CCCCCC">
<tr>
<td width="24%" bgcolor="#FFFFFF"> <div align="center"><font color="#FF0000" face="Arial, Helvetica, sans-serif"><a href="UserReg.asp">Register</a></font></div></td>
<td width="29%"><font face="Arial, Helvetica, sans-serif"> </font></td>
<td width="47%"><font face="Arial, Helvetica, sans-serif"> </font></td>
</tr>
<tr>
<td><div align="left"><font face="Arial, Helvetica, sans-serif"></font></div></td>
<td><font face="Arial, Helvetica, sans-serif"><strong>UserName:</strong>
</font></td>
<td><font face="Arial, Helvetica, sans-serif">
<input name="UserLogin" type="text" id="UserLogin" value="<%= Session("MM_UserName"
</font></td>
</tr>
<tr>
<td><div align="left"><font face="Arial, Helvetica, sans-serif"></font></div></td>
<td><font face="Arial, Helvetica, sans-serif"><strong>Password:</strong>
</font></td>
<td><div align="left"><font face="Arial, Helvetica, sans-serif">
<input name="PasswordLogin" type="password" id="PasswordLogin2" size="20" maxlength="14">
</font></div></td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif"> </font></td>
<td><div align="center"><font face="Arial, Helvetica, sans-serif"></font></div></td>
<td><div align="right"><font face="Arial, Helvetica, sans-serif">
<input type="submit" name="Submit" value="Log In">
</font></div></td>
</tr>
</table>
</div>
<div align="left"></div>
<div align="center"></div>
</form>
<p><br>
</p>
</body>
</html>
AND HERE IS MY DETAILS PAGE
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/MyDatabase.asp" -->
<%
Dim rsUser__MMColParam
rsUser__MMColParam = "1"
If (Session("MM_UserName"
rsUser__MMColParam = Session("MM_UserName"
End If
%>
<%
Dim rsUser
Dim rsUser_numRows
Set rsUser = Server.CreateObject("ADODB.Recordset"
rsUser.ActiveConnection = MM_MyDatabase_STRING
rsUser.Source = "SELECT * FROM Users WHERE UserName = '" + Replace(rsUser__MMColParam, "'", "''"
rsUser.CursorType = 0
rsUser.CursorLocation = 2
rsUser.LockType = 1
rsUser.Open()
rsUser_numRows = 0
%>
<%
Session("MM_UserID"
%>
<%
If Session("MM_UserID"
Response.Write("MM_UserID is Empty<br>"
Else
Response.Write("MM_UserID Not Empty " & Request("MM_UserID"
End If
If Session("MM_UserName"
Response.Write("MM_UserName is Empty<br>"
Else
Response.Write("MM_UserName Not Empty " & Request("MM_UserName"
End IF
%>
<html>
<head>
<title>MembersSection</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="98%" border="0">
<tr>
<td width="14%" height="27"> </td>
<td width="86%"><font size="3" face="Verdana, Arial, Helvetica, sans-serif">Welcome</font>
<font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("UserName"
</tr>
</table>
<br>
<form name="form1" method="post" action="">
<table width="100%" border="0">
<tr>
<td width="17%"> </td>
<td width="19%"><strong><font size="3" face="Arial, Helvetica, sans-serif">UserName</font></strong></td>
<td width="64%"><font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("UserName"
</tr>
<tr>
<td> </td>
<td><strong><font size="3" face="Arial, Helvetica, sans-serif">First Name</font></strong></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("FName"
</tr>
<tr>
<td> </td>
<td><strong><font size="3" face="Arial, Helvetica, sans-serif">Last Name</font></strong></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("LName"
</tr>
<tr>
<td> </td>
<td><strong><font size="3" face="Arial, Helvetica, sans-serif">Email Address</font></strong></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("EmailAddress"
</tr>
<tr>
<td> </td>
<td> </td>
<td><font face="Arial, Helvetica, sans-serif"> </font></td>
</tr>
</table>
</form>
<br>
<p> </p>
</div>
</form>
</body>
</html>
<%
rsUser.Close()
Set rsUser = Nothing
%>
Can Anybody please tell me why its not working, i've been ripping my hair out for weeks trying to get it to work.
If i remove the filter from recordset on the details page the error stops but it will only list the first record.
thanks
Thunderchild
Replies
Replied 17 Aug 2005 17:20:43
17 Aug 2005 17:20:43 Dave Blohm replied:
DW, while a great tool, often writes crappy code. Below is hand-written login code. The code I have written does away with the need for an error page and incorporates the login errors into the login page. It is also a hell of a lot less code.
First, we will assume you have two pages...login.asp and userdetails.asp
::::: BEGIN LOGIN.ASP :::::
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/MyDatabase.asp" -->
<%
' ::::: SEE IF THE USER THAT IS REQUESTING THE PAGE HAS ALREADY LOGGED IN.
' ::::: IF SO THEN BOUNCE HIM TO THE NEXT PAGE...IT'S ANNOYING TO GET A
' ::::: LOGIN FORM IF YOU'RE ALREADY LOGGED IN
if session("user_name"
<> "" and session("user_id"
<> "" then
response.redirect "userdetails.asp"
end if
' ::::: SEE IF THE FORM HAD BEEN SUBMITTED. IF SO, PROCESS THE LOGIN REQUEST
if request.form <> "" then
set rs_login = Server.CreateObject("ADODB.Recordset"
rs_login.ActiveConnection = MM_MyDatabase_STRING
rs_login.Source = "SELECT UserID, UserName, Password FROM users WHERE username='" & request.form("userlogin"
& "'"
rs_login.CursorType = 0
rs_login.CursorLocation = 2
rs_login.LockType = 1
rs_login.Open
' ::::: CHECK TO SEE IF THE USER EXISTS IN THE DATABASE
if not rs_login.eof and not rs_login.bof then
' ::::: THE USER EXISTS, SO NOW WE NEED TO SEE IF THE PASSWORD
' ::::: SUPPLIED IS GOOD
' :::::
' ::::: FIRST, IF THE PASSWORD IS GOOD, DO THIS...
if request.form("passwordlogin"
= rs_login("password"
then
session("user_name"
= rs_login("username"
session("user_id"
= rs_login("userid"
rs_login.close
set rs_login = nothing
response.redirect "userdetails.asp"
' ::::: IF THE PASSWORD IS NOT GOOD BOUNCE BACK TO THIS PAGE WITH
' ::::: AN ERROR CODE THAT WE CAN USE TO DISPLAY A "YOUR LOGIN
' ::::: FAILED BECAUSE..." MESSAGE
else
rs_login.close
set rs_login = nothing
response.redirect request.servervariables("script_name"
& "?error=2"
end if
' ::::: IF THE USER ACCOUNT DOESN'T EXIST IN THE DATABASE BOUNCE BACK TO THIS
' ::::: PAGE WITH AN ERROR CODE THAT WE CAN USE TO DISPLAY A "YOUR LOGIN FAILED
' ::::: BECAUSE..." MESSAGE
else
rs_login.close
set rs_login = nothing
response.redirect request.servervariables("script_name"
& "?error=1"
end if
end if
%>
<html>
<head>
<title>User Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="99%" border="0">
<tr>
<td><div align="center"><font size="6" face="Arial, Helvetica, sans-serif">User Login</font></div></td>
</tr>
</table>
<br>
<form ACTION="<%= request.servervariables("script_name"
%>" method="POST" name="Login" id="Login">
<div align="center">
<table width="75%" border="0">
<tr>
<td bgcolor="#FFFF97"> <div align="center"><font color="#0000A0" face="Arial, Helvetica, sans-serif"><strong>Please
use your username and password to login. If you are not currently
a member you can register by clicking on the register link.</strong></font></div></td>
</tr>
</table>
<table width="51%" border="0" align="center" bgcolor="#CCCCCC">
<%
' ::::: SEE IF AN ERROR CODE HAS BEEN PASSED. IF SO, DISPLAY THE
' ::::: APPROPRIATE MESSAGE
if request.querystring("error"
<> "" then
select case request.querystring("error"
case "1"
var_error_msg = "The user name that you attempted to log in with does not exist in our database."
case "2"
var_error_msg = "The password you entered was incorrect."
case else
var_error_msg = "An unspecified error occured."
end select
%>
<tr align="center">
<td colspan="3" bgcolor="red"><%= var_error_msg %></td>
</tr>
<% end if %>
<tr>
<td width="24%" bgcolor="#FFFFFF"> <div align="center"><font color="#FF0000" face="Arial, Helvetica, sans-serif"><a href="UserReg.asp">Register</a></font></div></td>
<td width="29%"><font face="Arial, Helvetica, sans-serif"> </font></td>
<td width="47%"><font face="Arial, Helvetica, sans-serif"> </font></td>
</tr>
<tr>
<td><div align="left"><font face="Arial, Helvetica, sans-serif"></font></div></td>
<td><font face="Arial, Helvetica, sans-serif"><strong>UserName:</strong>
</font></td>
<td><font face="Arial, Helvetica, sans-serif">
<input name="UserLogin" type="text" id="UserLogin" size="20" maxlength="15">
</font></td>
</tr>
<tr>
<td><div align="left"><font face="Arial, Helvetica, sans-serif"></font></div></td>
<td><font face="Arial, Helvetica, sans-serif"><strong>Password:</strong>
</font></td>
<td><div align="left"><font face="Arial, Helvetica, sans-serif">
<input name="PasswordLogin" type="password" id="PasswordLogin2" size="20" maxlength="14">
</font></div></td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif"> </font></td>
<td><div align="center"><font face="Arial, Helvetica, sans-serif"></font></div></td>
<td><div align="right"><font face="Arial, Helvetica, sans-serif">
<input type="submit" name="Submit" value="Log In">
</font></div></td>
</tr>
</table>
</div>
<div align="left"></div>
<div align="center"></div>
</form>
<p><br>
</p>
</body>
</html>
::::: END LOGIN.ASP :::::
::::: BEGIN USERDETAILS.ASP
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/MyDatabase.asp" -->
<%
' ::::: SEE IF THE USER HAS SUCCESSFULLY LOGGED IN. IF NOT, SEND THEM
' ::::: TO THE LOGIN PAGE. THIS WILL ALSO SEND THE USER BACK TO THE
' ::::: LOGIN PAGE IF THEY ARE INACTIVE FOR MORE THEN THE SESSION TIMEOUT
' ::::: VALUE (TYPICALLY 20 MINUTES).
if session("username"
= "" or session("userid"
= "" then
response.redirect "login.asp"
end if
Dim rsUser
Dim rsUser_numRows
Set rsUser = Server.CreateObject("ADODB.Recordset"
rsUser.ActiveConnection = MM_MyDatabase_STRING
rsUser.Source = "SELECT * FROM Users WHERE userid = " & cint(session("userid"
) ' <----- THIS ** cint(session("userid"
) ** ASSUMES THAT THE USERID FIELD IN YOUR TABLE IS A)AN INTEGER AND B) A UNIQUE IDENTIFIER
rsUser.CursorType = 0
rsUser.CursorLocation = 2
rsUser.LockType = 1
rsUser.Open()
%>
<html>
<head>
<title>MembersSection</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="98%" border="0">
<tr>
<td width="14%" height="27"> </td>
<td width="86%"><font size="3" face="Verdana, Arial, Helvetica, sans-serif">Welcome</font>
<font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("UserName"
.Value)%></font></td>
</tr>
</table>
<br>
<form name="form1" method="post" action="">
<table width="100%" border="0">
<tr>
<td width="17%"> </td>
<td width="19%"><strong><font size="3" face="Arial, Helvetica, sans-serif">UserName</font></strong></td>
<td width="64%"><font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("UserName"
.Value)%></font></td>
</tr>
<tr>
<td> </td>
<td><strong><font size="3" face="Arial, Helvetica, sans-serif">First Name</font></strong></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("FName"
.Value)%></font></td>
</tr>
<tr>
<td> </td>
<td><strong><font size="3" face="Arial, Helvetica, sans-serif">Last Name</font></strong></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("LName"
.Value)%></font></td>
</tr>
<tr>
<td> </td>
<td><strong><font size="3" face="Arial, Helvetica, sans-serif">Email Address</font></strong></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("EmailAddress"
.Value)%></font></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><font face="Arial, Helvetica, sans-serif"> </font></td>
</tr>
</table>
</form>
<br>
<p> </p>
</div>
</form>
</body>
</html>
<%
rsUser.Close()
Set rsUser = Nothing
%>
::::: END USERDETAILS.ASP :::::
Hope this helps. Let me know if you have questions.
Doc
Wycked Studios
wyckedstudios.com
Edited by - on 17 Aug 2005 17:22:14
Edited by - on 17 Aug 2005 17:25:55
First, we will assume you have two pages...login.asp and userdetails.asp
::::: BEGIN LOGIN.ASP :::::
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/MyDatabase.asp" -->
<%
' ::::: SEE IF THE USER THAT IS REQUESTING THE PAGE HAS ALREADY LOGGED IN.
' ::::: IF SO THEN BOUNCE HIM TO THE NEXT PAGE...IT'S ANNOYING TO GET A
' ::::: LOGIN FORM IF YOU'RE ALREADY LOGGED IN
if session("user_name"
response.redirect "userdetails.asp"
end if
' ::::: SEE IF THE FORM HAD BEEN SUBMITTED. IF SO, PROCESS THE LOGIN REQUEST
if request.form <> "" then
set rs_login = Server.CreateObject("ADODB.Recordset"
rs_login.ActiveConnection = MM_MyDatabase_STRING
rs_login.Source = "SELECT UserID, UserName, Password FROM users WHERE username='" & request.form("userlogin"
rs_login.CursorType = 0
rs_login.CursorLocation = 2
rs_login.LockType = 1
rs_login.Open
' ::::: CHECK TO SEE IF THE USER EXISTS IN THE DATABASE
if not rs_login.eof and not rs_login.bof then
' ::::: THE USER EXISTS, SO NOW WE NEED TO SEE IF THE PASSWORD
' ::::: SUPPLIED IS GOOD
' :::::
' ::::: FIRST, IF THE PASSWORD IS GOOD, DO THIS...
if request.form("passwordlogin"
session("user_name"
session("user_id"
rs_login.close
set rs_login = nothing
response.redirect "userdetails.asp"
' ::::: IF THE PASSWORD IS NOT GOOD BOUNCE BACK TO THIS PAGE WITH
' ::::: AN ERROR CODE THAT WE CAN USE TO DISPLAY A "YOUR LOGIN
' ::::: FAILED BECAUSE..." MESSAGE
else
rs_login.close
set rs_login = nothing
response.redirect request.servervariables("script_name"
end if
' ::::: IF THE USER ACCOUNT DOESN'T EXIST IN THE DATABASE BOUNCE BACK TO THIS
' ::::: PAGE WITH AN ERROR CODE THAT WE CAN USE TO DISPLAY A "YOUR LOGIN FAILED
' ::::: BECAUSE..." MESSAGE
else
rs_login.close
set rs_login = nothing
response.redirect request.servervariables("script_name"
end if
end if
%>
<html>
<head>
<title>User Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="99%" border="0">
<tr>
<td><div align="center"><font size="6" face="Arial, Helvetica, sans-serif">User Login</font></div></td>
</tr>
</table>
<br>
<form ACTION="<%= request.servervariables("script_name"
<div align="center">
<table width="75%" border="0">
<tr>
<td bgcolor="#FFFF97"> <div align="center"><font color="#0000A0" face="Arial, Helvetica, sans-serif"><strong>Please
use your username and password to login. If you are not currently
a member you can register by clicking on the register link.</strong></font></div></td>
</tr>
</table>
<table width="51%" border="0" align="center" bgcolor="#CCCCCC">
<%
' ::::: SEE IF AN ERROR CODE HAS BEEN PASSED. IF SO, DISPLAY THE
' ::::: APPROPRIATE MESSAGE
if request.querystring("error"
select case request.querystring("error"
case "1"
var_error_msg = "The user name that you attempted to log in with does not exist in our database."
case "2"
var_error_msg = "The password you entered was incorrect."
case else
var_error_msg = "An unspecified error occured."
end select
%>
<tr align="center">
<td colspan="3" bgcolor="red"><%= var_error_msg %></td>
</tr>
<% end if %>
<tr>
<td width="24%" bgcolor="#FFFFFF"> <div align="center"><font color="#FF0000" face="Arial, Helvetica, sans-serif"><a href="UserReg.asp">Register</a></font></div></td>
<td width="29%"><font face="Arial, Helvetica, sans-serif"> </font></td>
<td width="47%"><font face="Arial, Helvetica, sans-serif"> </font></td>
</tr>
<tr>
<td><div align="left"><font face="Arial, Helvetica, sans-serif"></font></div></td>
<td><font face="Arial, Helvetica, sans-serif"><strong>UserName:</strong>
</font></td>
<td><font face="Arial, Helvetica, sans-serif">
<input name="UserLogin" type="text" id="UserLogin" size="20" maxlength="15">
</font></td>
</tr>
<tr>
<td><div align="left"><font face="Arial, Helvetica, sans-serif"></font></div></td>
<td><font face="Arial, Helvetica, sans-serif"><strong>Password:</strong>
</font></td>
<td><div align="left"><font face="Arial, Helvetica, sans-serif">
<input name="PasswordLogin" type="password" id="PasswordLogin2" size="20" maxlength="14">
</font></div></td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif"> </font></td>
<td><div align="center"><font face="Arial, Helvetica, sans-serif"></font></div></td>
<td><div align="right"><font face="Arial, Helvetica, sans-serif">
<input type="submit" name="Submit" value="Log In">
</font></div></td>
</tr>
</table>
</div>
<div align="left"></div>
<div align="center"></div>
</form>
<p><br>
</p>
</body>
</html>
::::: END LOGIN.ASP :::::
::::: BEGIN USERDETAILS.ASP
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/MyDatabase.asp" -->
<%
' ::::: SEE IF THE USER HAS SUCCESSFULLY LOGGED IN. IF NOT, SEND THEM
' ::::: TO THE LOGIN PAGE. THIS WILL ALSO SEND THE USER BACK TO THE
' ::::: LOGIN PAGE IF THEY ARE INACTIVE FOR MORE THEN THE SESSION TIMEOUT
' ::::: VALUE (TYPICALLY 20 MINUTES).
if session("username"
response.redirect "login.asp"
end if
Dim rsUser
Dim rsUser_numRows
Set rsUser = Server.CreateObject("ADODB.Recordset"
rsUser.ActiveConnection = MM_MyDatabase_STRING
rsUser.Source = "SELECT * FROM Users WHERE userid = " & cint(session("userid"
rsUser.CursorType = 0
rsUser.CursorLocation = 2
rsUser.LockType = 1
rsUser.Open()
%>
<html>
<head>
<title>MembersSection</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="98%" border="0">
<tr>
<td width="14%" height="27"> </td>
<td width="86%"><font size="3" face="Verdana, Arial, Helvetica, sans-serif">Welcome</font>
<font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("UserName"
</tr>
</table>
<br>
<form name="form1" method="post" action="">
<table width="100%" border="0">
<tr>
<td width="17%"> </td>
<td width="19%"><strong><font size="3" face="Arial, Helvetica, sans-serif">UserName</font></strong></td>
<td width="64%"><font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("UserName"
</tr>
<tr>
<td> </td>
<td><strong><font size="3" face="Arial, Helvetica, sans-serif">First Name</font></strong></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("FName"
</tr>
<tr>
<td> </td>
<td><strong><font size="3" face="Arial, Helvetica, sans-serif">Last Name</font></strong></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("LName"
</tr>
<tr>
<td> </td>
<td><strong><font size="3" face="Arial, Helvetica, sans-serif">Email Address</font></strong></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif"> <%=(rsUser.Fields.Item("EmailAddress"
</tr>
<tr>
<td> </td>
<td> </td>
<td><font face="Arial, Helvetica, sans-serif"> </font></td>
</tr>
</table>
</form>
<br>
<p> </p>
</div>
</form>
</body>
</html>
<%
rsUser.Close()
Set rsUser = Nothing
%>
::::: END USERDETAILS.ASP :::::
Hope this helps. Let me know if you have questions.
Doc
Wycked Studios
wyckedstudios.com
Edited by - on 17 Aug 2005 17:22:14
Edited by - on 17 Aug 2005 17:25:55
Replied 18 Aug 2005 05:31:38
18 Aug 2005 05:31:38 peter mill replied:
Thanks Doc
Thanks for the code that you submitted, i will see if it helps.
But i do have a question with the code i sumbitted. What would stop a session variable from being available on the details page. If i can solve that then the problem goes away.
Also are there any free programs available available to watch the variables as the page is running. So i can see how the program is changing the variables.
thanks
Thunderchild
Thanks for the code that you submitted, i will see if it helps.
But i do have a question with the code i sumbitted. What would stop a session variable from being available on the details page. If i can solve that then the problem goes away.
Also are there any free programs available available to watch the variables as the page is running. So i can see how the program is changing the variables.
thanks
Thunderchild
Replied 18 Aug 2005 06:05:13
18 Aug 2005 06:05:13 peter mill replied:
hey doc
Tried the new code. And i am still being bounced back to the login page. I know why i just dont know how to fix it.
The session variable on the userdetails page is not getting the variable data. so it remains empty. i had the same problem with my code. <img src=../images/dmxzone/forum/icon_smile_dissapprove.gif border=0 align=middle>
I have reinstalled IIS twice and DW. I don't kow how to fix it, <img src=../images/dmxzone/forum/icon_smile_angry.gif border=0 align=middle> but its good to know that its not just my code that it doesn't like. At least i can have a little confidence in that.<img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
Also I know that its not the WIn2k OS because I have also tried it on WinXP, and it does the same thing.
So any Ideas on why its not passing/holding the session data??
Thanks
Thunderchild
Edited by - thunderchild on 18 Aug 2005 06:07:34
Tried the new code. And i am still being bounced back to the login page. I know why i just dont know how to fix it.
The session variable on the userdetails page is not getting the variable data. so it remains empty. i had the same problem with my code. <img src=../images/dmxzone/forum/icon_smile_dissapprove.gif border=0 align=middle>
I have reinstalled IIS twice and DW. I don't kow how to fix it, <img src=../images/dmxzone/forum/icon_smile_angry.gif border=0 align=middle> but its good to know that its not just my code that it doesn't like. At least i can have a little confidence in that.<img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
Also I know that its not the WIn2k OS because I have also tried it on WinXP, and it does the same thing.
So any Ideas on why its not passing/holding the session data??
Thanks
Thunderchild
Edited by - thunderchild on 18 Aug 2005 06:07:34
Replied 18 Aug 2005 18:30:43
18 Aug 2005 18:30:43 Dave Blohm replied:
Session variables are based upon session cookies...if you have cookies/session cookies disabled in your browser this would prevent you from being able to set session variables.
I think this is the offending code...
If MM_rsUser.EOF Or MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username"
= MM_valUsername
Session("MM_UserID"
= MM_rsUser.fields("UserID"
.Value
this appears to do the exact opposite of what the comment says...EOF or BOF means we found no records matching the criteria...so this is saying if you don't find a record in teh database then the authenticating user is valid...which makes zero sense...
check on the cookies and get back to me...
Doc
Wycked Studios
wyckedstudios.com
I think this is the offending code...
If MM_rsUser.EOF Or MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username"
Session("MM_UserID"
this appears to do the exact opposite of what the comment says...EOF or BOF means we found no records matching the criteria...so this is saying if you don't find a record in teh database then the authenticating user is valid...which makes zero sense...
check on the cookies and get back to me...
Doc
Wycked Studios
wyckedstudios.com
Replied 19 Aug 2005 17:28:23
19 Aug 2005 17:28:23 peter mill replied:
Hey
I spotted the code that you mention but it had nothing to do with the problem. I still don't know why the problem occured, but i did find out that it had nothing to do with the OS, IIS, Dreamweaver. I found out that the problem was somehow related to Internet Explorer. I reinstalled IE and the problem stopped. Go figure????
Thank you anyway for all your help. It's good to know that no matter how trivial the issue someone like you is willing to help. THANK YOU
Thunderchild
I spotted the code that you mention but it had nothing to do with the problem. I still don't know why the problem occured, but i did find out that it had nothing to do with the OS, IIS, Dreamweaver. I found out that the problem was somehow related to Internet Explorer. I reinstalled IE and the problem stopped. Go figure????
Thank you anyway for all your help. It's good to know that no matter how trivial the issue someone like you is willing to help. THANK YOU
Thunderchild
