Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Grabbing the current file name.....
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

bobby131313
Senior Member

USA
1163 Posts

Posted - 21 June 2007 :  10:05:48  Show Profile  Visit bobby131313's Homepage


I hope I can explain this well.

Here is a sample page I'm working on. I'm trying to eliminate tweaking each page in the yellow navigation box. Here is the code for it now...

<div id="rsslead">
    <a href="javascript: history.go(-1)">< Back</a>    <b>Narrow This Search</b>    <a href="javascript: history.go(+1)">Forward ></a><br />
<a href="1793-pcgs.asp">PCGS</a>  |  <a href="1793-ngc.asp">NGC</a>
  </div>


What I was wondering is, if there's a way to grab the current filename, minus the extesion, so that I can just slap that entire div in an include file like this...

<div id="rsslead">
    <a href="javascript: history.go(-1)">< Back</a>    <b>Narrow This Search</b>    <a href="javascript: history.go(+1)">Forward ></a><br />
<a href="Code to get filename minus extention-pcgs.asp">PCGS</a>  |  <a href="Code to get filename minus extention-ngc.asp">NGC</a>
  </div>


This would save me a lot of time. I hope I explained it well enough.

Thanks in advance!


Switch the order of your title tags

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 21 June 2007 :  10:08:39  Show Profile
strFileName=replace(mid(request.servervariables("script_name"),instrrev(request.servervariables("script_name"),"/")+1),".asp","")
You'll find something similar in inc_header.asp, but it doesn't strip out the extension.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 21 June 2007 :  23:44:58  Show Profile  Visit bobby131313's Homepage


Shaggy, you da man! Thank you!

I played with it for a while today and got it working flawlessly with this in the include file...

<%
dim strFileName :strFileName = replace(mid(request.servervariables("script_name"),instrrev(request.servervariables("script_name"),"/")+1),".asp","")

Response.Write  "<div id=""rsslead""><a href=""javascript: history.go(-1)"">< Back</a>    <b>Narrow This Search</b>    <a href=""javascript: history.go(+1)"">Forward ></a><br />" & vbNewLine

Response.Write  "<a href=""" & strFileName & "-pcgs.asp"">PCGS</a>  |  <a href=""" & strFileName & "-ngc.asp"">NGC</a></div>"
%>


Thanks again!


Switch the order of your title tags
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 22 June 2007 :  04:13:46  Show Profile
You're welcome, Bobby


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.61 seconds. Powered By: Snitz Forums 2000 Version 3.4.07