You are here: irt.org | BBS | Re: Passing CGI variables to other pages [This BBS is closed]
Posted by Martin Webb on September 15, 1998 at 10:04:14:
In Reply to: Re: Passing CGI variables to other pages posted by Jason Nugent on September 15, 1998 at 07:44:57:
: Yes, this can be done.
: Oh... sorry.. you wanted to know how :)
And Jason gives a excellent explanation of how to do this on the server side in the cgi script.
However, not everyone has access to the cgi script : (
In which case you can do it client side with JavaScript.
Take a normal link:
<A HREF="http://www.irt.org">Cool Site</A>
Now to capture the search string passed and tack it onto the link:
<A HREF="http://www.irt.org/index.htm" onClick="this.href=this.href+location.search">Cool Site</A>
However, if the user clicks the link then cancels the fetching of the page and then clicks it again we end up with a corrupt url, therefore best to use:
<A HREF="http://www.irt.org/index.htm" onClick="this.href='http://www.irt.org/index.htm'+location.search">Cool Site</A>
Now the questions is: Did you require a server side or client side solution :)
Follow-ups:
You are here: irt.org | BBS | Re: Passing CGI variables to other pages [This BBS is closed]