Forums
This topic is locked
A silly question?
Posted 23 Nov 2003 00:51:48
1
has voted
23 Nov 2003 00:51:48 Dave Burns posted:
I have sorted a user login. Now, what I want to do is do the check to see if they are logged in at the top of each page. If the session cookie is set at no, (not logged in) Send them to the login page. This is fine. Now comes the tricky bit, maybe not even possible. I know I can use response.redirect to send them to whatever page I want, (ie back to the login if the login fails, or to any other page if they log in correctly) but I want to send them back to the page they were trying to access when they were sent to login. Unfortunately, the way I plan to set up my admin menu, this could be any page. Is this possible? or should I set up an admin login page in the main site menu?Dave Burns
Replies
Replied 25 Nov 2003 05:27:59
25 Nov 2003 05:27:59 Dave Blohm replied:
Pretty simple to accomplish:
<% Response.Redirect "any_file.asp?returnto=" & Request.ServerVariables("SCRIPT_NAME"%>
any_file.asp is your login page and the variable returnto will hold the path to the file you requested...the path will be from the root of the website (ie, if the file is www.mysite.com/files/myfile.asp then the variable returnto will equal /files/myfile.asp)
Hope this isn't too convoluted...been a long day...
Hope this helps,
Doc
Doc
Rangewalk Digital Studios
<% Response.Redirect "any_file.asp?returnto=" & Request.ServerVariables("SCRIPT_NAME"%>
any_file.asp is your login page and the variable returnto will hold the path to the file you requested...the path will be from the root of the website (ie, if the file is www.mysite.com/files/myfile.asp then the variable returnto will equal /files/myfile.asp)
Hope this isn't too convoluted...been a long day...
Hope this helps,
Doc
Doc
Rangewalk Digital Studios