getting the page name

M

middletree

How do I request the actual page name that I'm on? This is going to go into
an include file, and depending on which page I'm on, I'd like to do
different things. I'm looking for "pagename.asp"
 
R

Ray at

Exract it from the SCRIPT_NAME server variable.

<%

Response.Write GetFilename

Function GetFilename
Dim sPath, aParts
sPath = Request.ServerVariables("SCRIPT_NAME")
aParts = Split("/" & sPath, "/")
GetFilename = aParts(UBound(aParts))
End Function
%>

Ray at work
 
S

Steve T

strPageName = Request.ServerVariables("SCRIPT_NAME") & "<br>"
if instr(strPageName,"/")>0 then
strPageName = right(strPageName, len(strPageName) -
instrRev(strPageName,"/"))
end if
response.write strPageName

Cheers
Steve
 
M

middletree

Not to sound defensive, but actually, 95% of the time, I do check
aspfaq.com. I find it a very valuable resource, and have a great
appreciation of it and you for making the site happen. In this case, I did
not check it, and I should have.
 
B

Brynn

Is there a problem with the home page hanging Aaron?

Brynn


middletree, I've noticed that a lot of your questions are answered in very
straightforward articles at www.aspfaq.com. In order to save yourself some
time, I might suggest searching there before posting here.
http://www.aspfaq.com/2072

Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!
 
R

Ray at

I can vouch for this. Middletree searches many places before posting! :]

Ray at work
 
B

Brynn

It is getting to this point when viewing source, then hanging for me
... everytime?


<html>
<head>
<title>ASP FAQ</title>

<script>
function showGrad(el,s,e,t) { document.all(el).style.filter =
"progid:DXImageTransform.Microsoft.Gradient(GradientType=,
StartColorStr='"+s+"', EndColorStr='"+e+"')"; }
function a(el)
{
if (document.all)
{
//document.body.style.cursor = 'pointer';
//showGrad(el, '#FFFFFF', '#bfd3ee');
document.all(el).style.color = "#6666cc";
}
}
function b(el)
{
if (document.all)
{
//document.body.style.cursor = 'default';
//document.all(el).style.filter = "";
document.all(el).style.color = "#333399";
}
}
</script>
<style>

* { font-family:franklin gothic medium, tahoma, verdana;
font-size:x-small; }
..td1 { margin-top: 1px solid #8aa6cb }
..menuTD { border-left:1px solid
#6884a9;cursor:hand;color:#333399;padding-left:4px; padding-right:4px;
}
..menuON { border-left:1px solid
#6884a9;color:#FFFFFF;padding-left:4px; padding-right:4px; }
..rTD { cursor:hand;color:#333399;padding-left:4px;
padding-right:4px;font-size:12px; }
..nTD { padding-right:10px;font-size:12px; }
..sTD { border-right: 1px solid
#cccccc;padding-left:4px;padding-right:4px;font-size:12px; }
..sTD2 { padding-left:4px;padding-right:4px;font-size:12px; }
..result { font-size:12px; }
..menuSPAN { font-size:11px;padding-left:4px; padding-right:4px; }
..footer { font-size:9px; }
..footerON { font-size:9px; color:#ff7800 }
INPUT, SELECT { font-size: 12px }
a { color:#333399; text-decoration:underline; padding-left:2px;
padding-right:2px }
a:hover { text-decoration:none; color:#ff7800; }
a.menu { color:#333399; font-size:11px; text-decoration:none;
padding-left:4px; padding-right:4px }
a.footer { padding-left:0px;padding-right:0px;text-decoration:none;
color:#333399; background:#ffffff }
a.footer:hover { text-decoration:none; color:#ff7800 }
a.f { padding-left:0px;padding-right:0px; text-decoration:none; }
a.f2 { padding-left:0px;padding-right:0px;
text-decoration:none;font-size:12px; }
a.f2:hover { color:#CC7800 }
a.g {
padding-left:0px;padding-right:0px;font-size:11px;color:white;text-decoration:none
}
..g2 { font-size:11px;color:#000080; }
a.g:hover { color:#000080 }
..txt { font-family:franklin gothic medium, tahoma, verdana;
font-size:9px;height:23px;background:#efefef;border:1px solid #a9a9a9
}
..but { border-style:groove; }
..sel { font-family:franklin gothic medium, tahoma, verdana;
font-size:9px;height:18px; }
..headline { font-family:tahoma;font-size:17px; }
..code
{
font-family:lucida console,ms gothic,courier
new;font-size:12px;color:#000080;
background:#ececec;line-height:14px;padding-left:15px;
border:1px solid #cccccc;
}
..codeb
{
font-family:lucida console,ms gothic,courier
new;font-size:12px;color:#000080;
}

@media print {
.hidePrint { display:none }
.hideScreen { display:all }
.footer { font-size:11px }
}

@media screen {
.hideScreen { display:none }
}

</style>
</head>

<body topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0
marginheight=0 marginwidth=0
bgcolor=#ffffff>


<table border=0 width=100% height=100% cellpadding=0 cellspacing=0>
<tr>
<td bgcolor=#8aa6cb width=150>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr valign=bottom>
<td bgcolor=#8aa6cb width=150><img src=a.gif vspace=55
width=150 height=40></td>
<td><table width=459 border=0 cellpadding=5
cellspacing=0><tr><td><!-- <b><span class=headline>ASP FAQ
4.0</span></b> -->


<p>We've added and enhanced many new features, including
printer-friendly
articles, a better <a class=f href=kbsearch.asp>KB
search engine</a>,
site and article <a class=f
href=stats.asp>statistics</a>, and an <a class=f
href=rss.asp>RSS feed</a>.

<p>This is still *your* site. No annoying pop-up ads, no
registration hassles, and no
fees. Just a fresh collection of ASP
and SQL Server articles to help you get your own
sites up and running, and keep them running.
If we help you out, though, remember to consider <a
class=f href=donate.asp>helping
us out</a> as well.

</td></tr></table><p>&nbsp;<p><img src=f.gif width=369
height=135></td>
</tr>
<tr>
<td bgcolor=#8aa6cb width=150 style='border-bottom:1px solid
#FFFFFF'>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr height=20>
<td bgcolor=#8aa6cb width=150>&nbsp;</td>
<td bgcolor=#8aa6cb align=right style='color:white'>
//&nbsp;&nbsp;<a class=g href=search.asp
onclick='this.blur();'>search</a>&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;<a
class=g href=kbsearch.asp onclick='this.blur();'>kb
search</a>&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;<a class=g href=news.asp
onclick='this.blur();'>news</a>&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;<a
class=g href=categories.asp
onclick='this.blur();'>categories</a>&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;<a
class=g href=downloads.asp
onclick='this.blur();'>downloads</a>&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;<a
class=g href=stats.asp
onclick='this.blur();'>statistics</a>&nbsp;&nbsp;&nbsp;</td>
</tr>
<tr valign=bottom>
<td bgcolor=#8aa6cb width=150 height=60 align=center
style='border-top:1px solid #FFFFFF'><a href='#' style='padding:0px'
onclick='document.donation.submit();return false;'><img
id='ppal'
src=/img/paypal.gif border=0 align=center hspace=10 title='
Help us pay for hosting.
Keep aspfaq.com ad-free! ' alt=' Help us pay for hosting.
Keep aspfaq.com ad-free! ' width=62 height=31 vspace=10></a></td>
<td>














Uh, not that I can tell.

Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!
 
B

Brynn

I KNOW my site is hanging ... LOL ... I just sent a nasty email to my
web host. my code is VERY clean ... but I am looking for a new host
with decent SQL space ... and ability to handle multiple domains in my
subdirectories ... any suggestions :)

Brynn


Are you sure you weren't loading your own site? ;]

Ray at work

Brynn said:
Is there a problem with the home page hanging Aaron?

Brynn

www.coolpier.com

Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!
 
R

Ray at

Get yourself a dedicated server from www.servermatrix.com and buy your own
SQL Server license (eegs!), use MSDE, or use MySQL. :]

Ray at home

Brynn said:
I KNOW my site is hanging ... LOL ... I just sent a nasty email to my
web host. my code is VERY clean ... but I am looking for a new host
with decent SQL space ... and ability to handle multiple domains in my
subdirectories ... any suggestions :)

Brynn


Are you sure you weren't loading your own site? ;]

Ray at work

Brynn said:
Is there a problem with the home page hanging Aaron?

Brynn

www.coolpier.com

Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!
 
A

Aaron Bertrand [MVP]

I think you're the only one... usually within 5 minutes of any problem I see
a flood of e-mails from "concerned" friends. :)
 
B

Brynn

Hmm, it may be just me ... but it consistantly, after cache clear and
everything ... gets to that same point, and stops ... what type of
commands do you have at that point in your code. I am not asking for
you to open up anything security wise, just general idea. Maybe I have
something wierd happening here.

Brynn



I think you're the only one... usually within 5 minutes of any problem I see
a flood of e-mails from "concerned" friends. :)

Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!
 
B

Brynn

Also off topic, what news reader do you recommend ... gettin sick of
mine.

Brynn

I think you're the only one... usually within 5 minutes of any problem I see
a flood of e-mails from "concerned" friends. :)

Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!
 
M

Mike

I KNOW my site is hanging ... LOL ... I just sent a nasty email to my
web host. my code is VERY clean ... but I am looking for a new host
with decent SQL space ... and ability to handle multiple domains in my
subdirectories ... any suggestions :)

Brynn

http://www.Hostingforabuck.net

1 GB of Disk Space (more available if needed)

10 GB of Bandwith

MS FrontPage

CGI, PHP, ASP, SSI, Pop3

10 MySQL Databases(more available if needed)

NO SET UP FEE

$8.00 per month

Custom Packages available as well
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top