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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to send link back to same page? 1

Status
Not open for further replies.

may1hem

Programmer
Jul 28, 2002
262
GB
I'm creating my ASP template and database, and with every modification of the template file I increment the filename. The current template filename is "index16.asp". At the moment, the links in the template file all point to "index.asp" which was the 1st version. Is it possible to have ASP automatically insert the current filename into the links?

Thx,

May
 
Just found out that this produces nearly the right result:

<%= Request.ServerVariables(&quot;PATH_INFO&quot;) %>

But this adds a forward slash as a prefix, so in my case it produces:

/index16.asp

How can i remove the forward slash?

Thx,
May
 
With VBScript, you can use the &quot;Len&quot; and &quot;Right&quot; functions:
Len(string | varname)
Right(string, length)

Dim OldPage, NewPage
OldPage = Request.ServerVariables(&quot;PATH_INFO&quot;)
NewPage = Right (OldPage, Len(OldPage - 1))
 
give a star dude


lately i have seen way too many unthankful uses. christ!!!!!
 
Good idea! Khazmir, I've given you a STAR!

I'm not up on stars - what happens when someone is given one?

Thanks,

May
 
Glad I could help and thanks for the star.

If you feel a post has been helpful to you, you give the poster a star/click on the link at the bottom of their post to cast a vote for &quot;TipMaster Of The Week&quot;. You don't need to be the one who asked the question to vote.
 
Just a shortcut version of Khazmir's sample code:
Code:
    Dim OldPage
    OldPage = Mid(Request.ServerVariables(&quot;PATH_INFO&quot;),2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top