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)
 getting name of current page, how?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

paco
Junior Member

Spain
187 Posts

Posted - 03 May 2001 :  07:37:45  Show Profile
Hi,

How can I get the name of a page from within the same page?

Anybody knows how to do it in ASP?

And in javascript?

Thanks,
Paco

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 03 May 2001 :  07:55:23  Show Profile  Visit Kat's Homepage
<%
Response.Write(Request.ServerVariables("PATH_INFO"))
%>

That is the ASP way to display it. Don't know about Javascript.

KatsKorner
Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 03 May 2001 :  09:00:05  Show Profile
Thanks Kat,

It does work. request.serverVariables("SCRIPT_NAME") also does the trick.

Anybody knows how to do it with javascript?

Regards,
Paco


Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 03 May 2001 :  11:36:48  Show Profile
found it.

location.href

Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 03 May 2001 :  12:14:59  Show Profile  Visit Kat's Homepage
oh yeah.. Should have remembered that!

KatsKorner
Go to Top of Page

MorningZ
Junior Member

USA
169 Posts

Posted - 03 May 2001 :  13:11:16  Show Profile  Visit MorningZ's Homepage  Send MorningZ an AOL message
I'm not sure about the others.. but when i use "SCRIPT_NAME" i also get the path to the file....

my workaround was this handy little function i wrote

Function GetPageName()
   temp = InStrRev( Request.ServerVariables("PATH_INFO"), "/" )
   GetPageName = Mid( Request.ServerVariables("PATH_INFO"), temp + 1 )
End function


Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 04 May 2001 :  05:26:10  Show Profile  Visit Kat's Homepage
Yep - I do that too.

KatsKorner
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 04 May 2001 :  14:34:05  Show Profile  Visit HuwR's Homepage
just to be different, I do it like this

temp = split( Request.ServerVariables("PATH_INFO"), "/" )
scriptname= temp( ubound(temp))


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.91 seconds. Powered By: Snitz Forums 2000 Version 3.4.07