mrwebdev
asked on
ASP - MDB Login with a Twist?
Microsoft (MDB) Login validation.
Form login:
ASP question, How would you validate a Member & Password form fields in a Form named "login" to make sure they exist and match in a table, and if so, then pass another field (MailingListID) in that same table row to a string receiving ASP page to show that users data from that entire row.
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ------
I am currently using (<%=MM_LoginAction%>) for the action, a Macromedia extension
concidering using a custom script on ("member-update-now.asp" or "member-login.asp").
<form method="POST" action=" " name="LogIn">
Member Log In
Member : <input type="TEXT" name="Member" size="20">
Password: <input type="PASSWORD" name="Password" size="20">
<input name="login" type="submit" value="Submit Login">
</form>
Redirect if success: member-update-now.asp
Redirect if failed: member-signup.asp or possibly self (member-login.asp)
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -------
Thanks in advance... please smart@sses need not reply!
Form login:
ASP question, How would you validate a Member & Password form fields in a Form named "login" to make sure they exist and match in a table, and if so, then pass another field (MailingListID) in that same table row to a string receiving ASP page to show that users data from that entire row.
--------------------------
I am currently using (<%=MM_LoginAction%>) for the action, a Macromedia extension
concidering using a custom script on ("member-update-now.asp" or "member-login.asp").
<form method="POST" action=" " name="LogIn">
Member Log In
Member : <input type="TEXT" name="Member" size="20">
Password: <input type="PASSWORD" name="Password" size="20">
<input name="login" type="submit" value="Submit Login">
</form>
Redirect if success: member-update-now.asp
Redirect if failed: member-signup.asp or possibly self (member-login.asp)
--------------------------
Thanks in advance... please smart@sses need not reply!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
PS: Instead of using the URL field I used the MailingListID field.
ASKER
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("U
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
MM_valUsername=CStr(Reques
If MM_valUsername <> "" Then
MM_fldDynamicRedirect="Mai
MM_fldUserAuthorization=""
MM_redirectLoginSuccessDyn
MM_redirectLoginFailed="me
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_fla
MM_rsUser.ActiveConnection
MM_rsUser.Source = "SELECT member, password"
If MM_fldDynamicRedirect <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldDynamicRedirect
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM members WHERE member='" & Replace(MM_valUsername,"'"
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_UserAuthorizat
ElseIf (MM_fldDynamicRedirect <> "") Then
'---------My Modifications---------note
MM_redirectLoginSuccessDyn
'-------------------------
Else
Session("MM_UserAuthorizat
End If
if CStr(Request.QueryString("
MM_redirectLoginSuccessDyn
End If
MM_rsUser.Close
Response.Redirect(MM_redir
End If
MM_rsUser.Close
Response.Redirect(MM_redir
End If
%>
This is a modified version of Login redirect to a URL in a databse extension from Macromedia's Exchange.