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!

How to append a variable to the URL via link? 1

Status
Not open for further replies.

ColonelBlue

Technical User
Jun 24, 2004
110
US
Hello.

I have a page called ../thispage.asp
and on that page I have a link where I would like ?var=this appended to the same page when it is clicked so it will refresh to ../thispage.asp?var=this.

Because I am creating a include file, hard coding the page name will not work if I use that include page in let's say another papge called thatpage.asp. If it was hard coded in the link, it would go to thispage instead.

Is there a way to do this?

Thanks in advance.
 
So, this line that you want to create is in your include file and it needs to be dynamic (to refer to the current page)? You should just be able to use the request.servervariables("URL") which would pick up the base portion of the current URL (the "thispage.asp" portion). You then add the querystring variable to it as needed.

For more information on the request.servervariables, check out 4GuysFromRolla.com

------------------------------------------------------------------------------------------------------------------------
If you don't have a sense of humor, you probably don't have any sense at all.
- Anonymous
 
Thanks Chopstik, you rock.
I will check it out.

Thank you! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top