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.
|
|
|
|
|
![]() |
||
Returing to original page after login
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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 %> ![]() |
|
|
|
|||
|
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. |
|
|||
|
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. |
|
||||
|
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")
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
![]() |
| Tags |
| login, page |
| Thread Tools | |
|
|
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 |