need the active page name

F

François

Hello,
I would like to know what kind of vbscript I can use to check wether if a
certain page exist or not on my web site.

Could anyone help me ?

Thanks.
 
T

Thomas A. Rowe

Look into using:

Request.ServerVariables("SCRIPT_NAME")

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
F

François

I have tested this in vbscript but it appears not to be vbscript...

I was thinking using ActiveDocument.Url but this give me something like
file:///n:\dir\htmlpage.htm (when I test on my local drive) using vbscript.

Like this I can't use the dir function to test wether a specific page is
there or not.

Thanks for your help.
 
T

Thomas A. Rowe

Do you know how to write ASP code using VBScript and that you must name the page with a .asp
extension and test it via http under a Windows IIS web server?
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
F

François

Thanks again for your quick reaction. In fact there is no asp page just
common html pages but I have understood that we can use vbscript on html
pages no ?

I will explain my objective to me more clear.
I have a site with 4 languages (spanish, italian, french and english)
(http://www.fitforeurope.be). It is possible that due to translation problems
the translation is not yet done in one or several languages.
I would lilke to tell the visitor which pages are availabe in which language
by displaying a flag (in upper right corner of the header if you look at the
site).

For the Request.ServerVariables("SCRIPT_NAME"), could you explain to me how
this is integrated in the pages ?

Thanks
 
T

Thomas A. Rowe

1. You have to be able run ASP, which means your site needs to be hosted on Windows IIS web server.

2. All page must have .asp extensions so that any VBScript is processed on the server, otherwise
only IE is able to process VBScript on the client side (browser)

3.
<%
CurrentPage = Request.ServerVariables("SCRIPT_NAME")
%>

To display, do the following

<%=CurrentPage%>
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
Top