I have an login asp program that accepts a user name and password to get access to member articles.
I can get the program after verification to redirect to a page, but what I'd like to do is have it redirect the original session url (the first link that was clicked on) Does anyone know if this is possible? I'm cutting and pasting some of the code below with some comments. Any help would be great appreciated.
<%
Session("nyatep_ConnectionString") = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= deleted for Security reasons Info=False"
Username = Request.Form("username")
Password = Request.Form("password")
Set login = Server.CreateObject("ADODB.RecordSet")
cmd = "SELECT * FROM tblMembers WHERE (username = '" & username & "') AND "
cmd = cmd & "(password = '" & password & "') "
'response.write cmd
'Response.End
login.Open cmd,Session("nyatep_ConnectionString"), 3, 1
session("member") = 0
If login.RecordCount = 1 Then
if login.Fields("member") = 1 then
session("member") = 1
end if
Session("memberId") = login.Fields("memberId")
Session("username") = login.Fields("username")
Session("Verified") = True 'they can view mailings
Session("url") = "" I think this is where I need to assign the session url value.
If Len(Session("url")) = 0 Then
Response.Redirect "article2.asp"
Else
'Response.Write " "
Response.Redirect Session("url")
End If
' Login Failed
Else
Response.Redirect "default.asp?error=1" 'No Such Login Name or Wrong Password
End If
%>
I can get the program after verification to redirect to a page, but what I'd like to do is have it redirect the original session url (the first link that was clicked on) Does anyone know if this is possible? I'm cutting and pasting some of the code below with some comments. Any help would be great appreciated.
<%
Session("nyatep_ConnectionString") = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= deleted for Security reasons Info=False"
Username = Request.Form("username")
Password = Request.Form("password")
Set login = Server.CreateObject("ADODB.RecordSet")
cmd = "SELECT * FROM tblMembers WHERE (username = '" & username & "') AND "
cmd = cmd & "(password = '" & password & "') "
'response.write cmd
'Response.End
login.Open cmd,Session("nyatep_ConnectionString"), 3, 1
session("member") = 0
If login.RecordCount = 1 Then
if login.Fields("member") = 1 then
session("member") = 1
end if
Session("memberId") = login.Fields("memberId")
Session("username") = login.Fields("username")
Session("Verified") = True 'they can view mailings
Session("url") = "" I think this is where I need to assign the session url value.
If Len(Session("url")) = 0 Then
Response.Redirect "article2.asp"
Else
'Response.Write " "
Response.Redirect Session("url")
End If
' Login Failed
Else
Response.Redirect "default.asp?error=1" 'No Such Login Name or Wrong Password
End If
%>