Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


ASP login area question

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,38826
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> ASP login area question
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 ASP login area question - 10/17/2006 9:25:50 PM   
  ThatOtherGuy

 

Posts: 3
Score: 0
Joined: 10/17/2006
Status: offline
Hi,

I have created a website and the homepage is accessible to anyone. But as soon as the user wants to go to any other page, they are prompted to login. If the log in is successful, they are taken back to the homepage and from there the user can access any page on my site. What can I do to take the user to the page that they originally intended to go to after logging(whatever page that may be) instead of first being taken back to the home, because I'm thinking that after people log in and see the home page, they may think that something isn't working right, because they have to click twice to get to the page.

I downloaded my code from the Net and just modified it, so if you need me to post my code, I will gladly do so. Thanks in advance for your prompt responses.
 
 
Post #: 1
 
 RE: ASP login area question - 10/18/2006 6:52:10 PM   
  ThatOtherGuy

 

Posts: 3
Score: 0
Joined: 10/17/2006
Status: offline
Hi,
I used the following code to try and redirect the person to their intended destination after they logged in but I failed<% = Request.ServerVariables("HTTP_REFERER") %> If I place this code on the login page, the value it picks up is the homepage and if i put it in my verify.asp page, it picks up the login page. But it wouldn't pick up my intended destination. The code in my protected files are as follows:
<%
'Check if user is logged in
if Session("name") = "" then
'If not, go to login page
Response.Redirect("login.asp")
else
'If, build page
Response.Write("<title>ASP Page</title>")
Response.write("<center>Welcome " & Session("name") & "<br><a href=logout.asp>Logout</a></center>")
end if
%>
Any help would be appreciated.

(in reply to ThatOtherGuy)
 
 
Post #: 2
 
 RE: ASP login area question - 10/19/2006 1:12:16 AM   
  Country73


Posts: 716
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
This webpage may help you out in your login/redirect issue:
http://www.elated.com/tutorials/programming/asp/password_protection/

(in reply to ThatOtherGuy)
 
 
Post #: 3
 
 RE: ASP login area question - 10/19/2006 3:19:19 AM   
  ThatOtherGuy

 

Posts: 3
Score: 0
Joined: 10/17/2006
Status: offline
Hi,

Thanks for your response. Unfortunately this doesn't exactly answer my issue. In this example, you are redirected to one specific page. I need help redirecting the user to the page page he intended to go to when he was asked to log in.

A friend suggested I try the following: "dump the link to the page the user wanted to go to in a session variable...then in your login page, check if there's a value in this variable and direct to it, else go to normal home page."

Is this a good method and do you perhaps have an example of how this can be accomplished. Thanks

(in reply to Country73)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> ASP login area question Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts