Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Some FrontPage (counter)

Posted on 1998-05-31
13
238 Views
Last Modified: 2013-12-25
Hi
I'm looking for a smart way to inspect some counters from a web site with FpExtensions. I have tryed to "include the cnt file into an HTML file... however this does'nt work. Also try to open that particular cnt file in the web browser does'nt work, even if I set the Netscape options to open the notepad.exe for files with cnt extension.

Also:
Does anyone have experience on running a larger number of counters (more than 100)  with Frontpage? If yes, is working in a proper way?

Cheers
Jörgen Aström
0
Comment
Question by:jastroem
  • 7
  • 6
13 Comments
 
LVL 1

Expert Comment

by:TAMC
ID: 1856880
The easiest way to do this would be to use some script, either javascript or vbscript, even better you could write asp, tell me which so I know which to write.
0
 

Author Comment

by:jastroem
ID: 1856881
Hi, and thank you for your answer.

Actually it doesn't matter in what way it is done...
What I want is to view just any kind of counter file (simple files only containg a number)
within my browser. If it's a script or an asp solution is not that important.

Please tell me how many points you expect for a "job" like that. And please also tell what you need to know about my server envirments.

Best wishes
jörgen Aström
0
 
LVL 1

Accepted Solution

by:
TAMC earned 100 total points
ID: 1856882
Well first of all if I am going to write this in ASP your server has to be running IIS 3.0 and has ASP installed, comment me back, and I'll start writing the ASP script.  I guess a 100 points will do.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 1

Expert Comment

by:TAMC
ID: 1856883
Here, this worked on my machine, with IIS 3.0 and ASP installed, if this isn't up to your specs just comment me thanks.

Notes: change the line OpenTestFile("C:\boot.ini") to the path of the cnt file you want to open, also besides ReadAll there is ReadLine, and just Read, if you would rather use those, just comment me again.

<% @ LANGUAGE="VBSCRIPT" %>
<%
 OPTION EXPLICIT
 Dim file,filesystem,text
%>
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
  Set filesystem = CreateObject("Scripting.FileSystemObject")
  Set file = filesystem.OpenTextFile("c:\boot.ini")
  text = file.ReadAll
  file.Close
  Response.Write text
%>
</BODY>
</HTML>
0
 

Author Comment

by:jastroem
ID: 1856884
I will try it. Tell me do just have to cut'n paste the code into an html file?
The problem might be the path to the files. Actually this is my main problem in some cgi I'm trying out right now... My server is a virtual server and it's so confusing to find out the proper way to my dierctorys. (it is a NT 4 Server IIS and I should be able to run ASP on it)

Thanks / Jörgen
0
 
LVL 1

Expert Comment

by:TAMC
ID: 1856885
What is in my answer is a whole file, it will work on its own.  If you want to incorporate it in to your own HTML file do this:

1) Put the following code at the top before anything else, again change boot.ini to the path of your file on the server if its in the same directory you can just put the file name(just like images):
   <% @ LANGUAGE="VBSCRIPT" %>
   <%
    OPTION EXPLICIT
    Dim file,filesystem,text
    Set filesystem = CreateObject ("Scripting.FileSystemObject")
    Set file = filesystem.OpenTextFile("c:\boot.ini")
   %>
2) Put the following code where you want to display the counter information.
   <% text = file.ReadAll
      Response.Write text %>
3) Put this when your done with the counter information
   <% file.Close %>
4) Rename the file to have an .asp extension (otherwise it won't work)
5) Put the file in a directory where you have read and execute rights(Might work in your cgi-bin directory?)
6) Hurray! should work, if not, comment again.

0
 

Author Comment

by:jastroem
ID: 1856886
I will try it. Tell me do just have to cut'n paste the code into an html file?
The problem might be the path to the files. Actually this is my main problem in some cgi I'm trying out right now... My server is a virtual server and it's so confusing to find out the proper way to my dierctorys. (it is a NT 4 Server IIS and I should be able to run ASP on it)

Thanks / Jörgen
0
 
LVL 1

Expert Comment

by:TAMC
ID: 1856887
Huh, your repeating yourself.
0
 

Author Comment

by:jastroem
ID: 1856888
I will try it. Tell me do just have to cut'n paste the code into an html file?
The problem might be the path to the files. Actually this is my main problem in some cgi I'm trying out right now... My server is a virtual server and it's so confusing to find out the proper way to my dierctorys. (it is a NT 4 Server IIS and I should be able to run ASP on it)

Thanks / Jörgen
0
 

Author Comment

by:jastroem
ID: 1856889
I will try it. Tell me do just have to cut'n paste the code into an html file?
The problem might be the path to the files. Actually this is my main problem in some cgi I'm trying out right now... My server is a virtual server and it's so confusing to find out the proper way to my dierctorys. (it is a NT 4 Server IIS and I should be able to run ASP on it)

Thanks / Jörgen
0
 

Author Comment

by:jastroem
ID: 1856890
I'm sorry I thought I could only reload this window to see if there's an "answer" from you.
Please forgive me for your unconvinence...
0
 

Author Comment

by:jastroem
ID: 1856891
Here's the result of my tests:

The server returns this (in German)
Laufzeitfehler in Microsoft VBScript-Fehler '800a004c'
Pfad nicht gefunden
/cgi-bin/test.asp, Zeile 6

It says Runtime Error in Microsoft...
path not found
/cgi-bin/test.asp, line6

And here's the asp doc (named test.asp):

<% @ LANGUAGE="VBSCRIPT" %>
<%
           OPTION EXPLICIT
           Dim file,filesystem,text
           Set filesystem = CreateObject ("Scripting.FileSystemObject")
           Set file = filesystem.OpenTextFile("_private/home.htm.cnt")
          %>
<html>

<head>
<title>TEST</title>
</head>

<body>
<% text = file.ReadAll
             Response.Write text %>
<% file.Close %>
</body>
</html>

___________________________

I have put the test.asp into my cgi-bin folder.

Any smart hints?

Thank you in advance
0
 
LVL 1

Expert Comment

by:TAMC
ID: 1856892
I will get back to you by the time EE says its 5:00 pm.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question