Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Going Backwards?

Status
Not open for further replies.

Jimuniguy

Technical User
Mar 6, 2002
363
GB
Hi,

In javascript we can use the feature:

Code:
history.go(-1)
to go back one page.

However, I need to pass some variables when I go backwards. At present, the variables are passed on via the ahref code like this:

Code:
<a href=&quot;page.asp<% =variablestring %>&quot;>

Problem is, that
Code:
history.go(-1)<% =variablestring %>[/
does not work and I need the equivlent of this to work.

Does anyone know how to do it please?

Thank you

James
 
you really cannot do this using history.back(). you may use <a href=&quot;page.asp<% =variablestring %>&quot;> but you need to edit the page.asp to handle the variablestring using request.querystring()
 
Hi,

I know I can not use Javascript to do this.

The
Code:
<a href=&quot;page.asp <% =variablestring %>&quot;>
just shows how at present I would normally pass my variables forward

Here is the main problem.

I have a page which is controlled using variables. I go fowards a page which produces new variables to control the page. I now want to go back to the old page with the new variables.

Any clearer?

James
 
Hi,

I also have this function I have found:
Code:
    function mstrGetRelativeURL()
    	
    	mstrGetRelativeURL=Request.serverVariables(&quot;PATH_INFO&quot;)
    	
    End function

But if this was to work, how could i set it up as a variable to be passed on in the url?
 
you need to include somewhere in your page.asp some routines to handle the variablestring as if you're POSTING to that page. however, you need to parse variablestring. i suggest, instead of concatenating the values to form variablestring, if your using forms for your new varibles
simply add some code like this:

strVariable1 = request.form(&quot;txtVaribale1&quot;)
strVariable2 = request.form(&quot;txtVariable2&quot;)

 
Hi,

Its ok thanks. Suddenley found the right keywords to enter into google.

You can do it via:
Code:
<a href=&quot;<%= Request.ServerVariables(&quot;HTTP_REFERER&quot;)%><%=variablestring %>&quot;>Me</a>

This then brings back the last page from that user and will take the user to it with your choosen variable string.

Neat

Cheers jmerencilla though for your thoughts!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top