Returing to original page after login

This is a discussion on "Returing to original page after login" within the JavaScript Forum section. This forum, and the thread "Returing to original page after login are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Dec 25th, 2006, 09:58
New Member
Join Date: Dec 2006
Location: london
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Returing to original page after login

Hi,

I use a simple login script for members which works fine. However, there are different pages from where they can launch the login process and instead of stipulating the page they alway go to after a sucessful login, I would like to send them back to the page they launched the login process from. Is that possible, I've attached a copy of the login script and the part where it redirects them to the home page instead of the page they were looking at just prior to the launch of the login process.

'Admin and user functions
'------------------------------------------------------------
Const strLevel2Delete = "False" 'Allow level 2 members to delete other members?
Const strLevel2Admin = "False" 'Allow level 2 members add/modify other members. NOTE, level 2 cannot delete members, or see there passwords. Default = True
Const strLevel1Edit = "True" 'Allow level 1 members to modify their profile. NOTE, level 1 cannot change there login count, access levels, or anyother members. Default = True
Const strAllowRegister = "False" 'Allow people to register? Change to to "No" if you dont want to allow registering. Default = True
Const strAllowLogin = "False" 'Allow Login After Register? Change to to "False" if you dont want to allow login in after registering. Default = True
Const strAllowDoubleUserNames = "False" 'Allow more than 1 users names to be the same? Change to "False" if you to allow double usernames. Default = False
Const strAllowDoubleEmails = "False" 'Allow more then one unique email address to be the same? Change to "False" if you dont want to allow double emails for users. Default = False
Const strRequireEmail = "True" 'Make the email address of each user required
Const strLevel1Login = "../home/home.asp" 'Where the access level 1 (lowest member) is redirected to after login
Const strLevel2Login = "admin_menu.asp" 'Where the access level 2 is redirected to after login
Const strLevel3Login = "admin_menu.asp" 'Where the access level 3 (admin) is redirected to after login


'Login pages
'------------------------------------------------------------
Const strLoginPage = "login.asp" 'Default Page for logging in. Default = login.asp
Const strAuthorizedPage = "../home/home.asp" 'Authorized Page for after logging in. Default = authorised_user_page.asp
Const strUnAuthorisedPage = "login.asp" 'Unauthorised Page for unauthorized users. Default = unauthorised_user_page.htm
%>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Dec 27th, 2006, 12:28
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Returing to original page after login

I can tell you what to do in principle but not the actual code as you appear to be using ASp and it's not my thing.

Anyway, I'm guessing that like php, asp must have a mechanism for picking up the referring page when it processes some code.

You need to pick up that piece of information and use it as the target for your redirection on successful login.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Dec 28th, 2006, 06:18
New Member
Join Date: Jun 2006
Location: Chennai, India
Age: 30
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Returing to original page after login

I have workied on project with similar requirements.

All that you'll have to do is store the "url" of your existing application/page before displaying the login page/application. AFter successfull login, redirect the user to the application/url we have stored.

Okie!! try doing something.!! try to reply to a post in this forum without logging in. You would be asked to login and after successful login, you would redirected to the same page/link you were trying to access.
Hope you got the idea.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Dec 28th, 2006, 10:16
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,192
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
Re: Returing to original page after login

Session("url") = request.servervariables('script_name')

The above will store the CURRENT page in a variable.

Once logged in, just issue this:-

response.redirect Session("url")
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
login, page

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a login page (beginner)?? sing2trees Databases 11 Jun 19th, 2008 00:27
php login page was working but is not anymore? bonnit PHP Forum 6 May 26th, 2008 05:16
[SOLVED] php Login page dhossai PHP Forum 26 Oct 17th, 2007 17:53
Login page HELP!!!!! biggy1985 PHP Forum 1 Apr 25th, 2007 14:38
help creating a login and logout page geyids PHP Forum 14 Mar 26th, 2007 06:35


All times are GMT. The time now is 15:19.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42