473,511 Members | 17,673 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Code to return to calling page

qaz
I have login links on a number of pages in my site. Some of the pages
expect variables on the querystring.

I want to be able to login from any of these pages. The login link
redirects me to a login page. I want to go back to the page I came from and
preserve the variables on the querystring.

Can anyone give me a short script to have a user return to a calling page
that preserves the querystring?

For what it is worth, I has used a simple response.redirect
request.servervariables("script_name") until I realized that I was losing
the querystring.

I also tried this, but it did not work - (it kept posting me to the login
page regardless of where I came from)

dim sQS
sQS = request.querystring

.... [code here ] ...

response.redirect request.servervariables("script_name") & sQS

Any help is appreciated.
Jul 22 '05 #1
2 4726
qaz wrote on 30 jan 2005 in microsoft.public.inetserver.asp.general:
dim sQS
sQS = request.querystring

... [code here ] ...

response.redirect request.servervariables("script_name") & sQS


You forget to insert the questionmark:

sQS = request.querystring
sSn = request.servervariables("url")
response.redirect sSn & "?" & sQS

=======================

A solution seems(!) to me to include on top of
every restricted page a "lockInclude.asp" include, that:

1 checks for the session variable "loggedinAs" not being empty,

2 if empty, displays a login form [followed by response.end],
submitting to the page, not just the include of course, itself.

The "lockInclude.asp" pseudocode, just the idea:

<%
if session("loggedinAs")<>"" then
' do nothing and go on with the calling page
' or perhaps do some householding tasks
elseif request.form("loginname")<>"" then
' Check the name/password for validity
' fill session("loggedinAs") only if check=ok
sQS = request.querystring
sSn = request.servervariables("url")
response.redirect sSn & "?" & sQS
else
%><html>..<form><input... <% ' ask for name/password
' build like a completely seperate login.asp, but is not
response.end
end if
%>

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 22 '05 #2
qaz
Thanks, Evertjan. Yes, I was forgetting the "?". It's strange how you can
look at something so much that you don't notice the obvious!!

Good idea on the lockInclude.asp. I think I will try it.

Thank you very much.

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
qaz wrote on 30 jan 2005 in microsoft.public.inetserver.asp.general:
dim sQS
sQS = request.querystring

... [code here ] ...

response.redirect request.servervariables("script_name") & sQS


You forget to insert the questionmark:

sQS = request.querystring
sSn = request.servervariables("url")
response.redirect sSn & "?" & sQS

=======================

A solution seems(!) to me to include on top of
every restricted page a "lockInclude.asp" include, that:

1 checks for the session variable "loggedinAs" not being empty,

2 if empty, displays a login form [followed by response.end],
submitting to the page, not just the include of course, itself.

The "lockInclude.asp" pseudocode, just the idea:

<%
if session("loggedinAs")<>"" then
' do nothing and go on with the calling page
' or perhaps do some householding tasks
elseif request.form("loginname")<>"" then
' Check the name/password for validity
' fill session("loggedinAs") only if check=ok
sQS = request.querystring
sSn = request.servervariables("url")
response.redirect sSn & "?" & sQS
else
%><html>..<form><input... <% ' ask for name/password
' build like a completely seperate login.asp, but is not
response.end
end if
%>

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6735
by: David Walker | last post by:
Hi I have a Microsoft SQL database I can use (also mySQL, so if you know how to do this in mySQL that is just as useful). The database can only be accessed from webpages hosted on the same server...
2
6279
by: dmiller23462 | last post by:
Hey guys, I'm back again....I've got the results displaying that I wanted but instead of having a "next" or "previous" link displayed I am getting the error msg below (I actually get the data that...
242
13135
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
8
1409
by: Kayda | last post by:
Hello: I had some code that allowed me to expand a paragraph by clicking on a hyperlink and collapse it by clicking on the paragraph. I unfortunately the Javascript function. I still have the...
14
1420
by: genus_ | last post by:
The below code compiles and runs smoothly. Can any one at least explain to me what its doing for first few lines? Thank you. Here's the code: #include <stdio.h> main(t,_,a) char *a;...
8
5345
by: Brett Robichaud | last post by:
I understand how code-behind can handle events for a page, but can I call a code-behind method from within a <script> tag in my ASP.Net page, or can I only call methods defined in other <script>...
18
2240
by: Ed Jay | last post by:
<disclaimer>js newbie</disclaimer> My page has a form comprised of several radio buttons. I want to poll the buttons to determine which button was selected and convert its value to a string. I...
4
5796
by: =?Utf-8?B?QXZhRGV2?= | last post by:
ASP.Net 2. We are migrating to Windows 2008 64 bit Server with IIS 7 from Windows 2003 32 Bit with IIS 6. A few library classes we wrote uses impersonation in code like explained in this...
1
2470
Dormilich
by: Dormilich | last post by:
Hi, I'm running into a problem with the <xsl:processing-instruction> element (Sablotron). purpose: I generate a xhtml fragment from a xml file via xslt. This is printed (echo) to the output...
0
7245
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7144
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7427
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5069
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.