Print Page | Close Window

Problem with ASP Hit Counter

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=22036
Printed Date: 29 March 2026 at 7:46pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Problem with ASP Hit Counter
Posted By: AyChihuahuas
Subject: Problem with ASP Hit Counter
Date Posted: 26 November 2006 at 9:21pm
Hi there. I hope someone can help me. I am BRAND NEW to ASP and no next to nothing about it. I do know enough html to get me by tho and I hope someone here will be able to walk me through my problem.

I am trying to use the Web Wiz ASP Graphical Hit Counter. I have followed the tutorial but the tut tells me to save my script as an .asp file. I have uploaded it to my server and it works great when I load the page.... The only problem is that I want the counter to appear on my index page. My site won't load as asp file as the initial page....

Am I making any sense?

You can view the asp file and see that it is working fine at http://www.aychihuahuas.com/index.asp and see what I want my index page to look like but I dont know how to embed the asp in an .html page and get the counter to be viewed like the free counter is at http://www.aychihuahuas.com/index.html

Can anyone offer me a glimmer of hope? Any and ALL input will be GREATLY appreciated.

Sincerely,

- Bill



Replies:
Posted By: dpyers
Date Posted: 26 November 2006 at 11:42pm
A page with asp code has to have a .asp extension to clue the server to run the code before displaying the page. A .htm or .html page won't run the asp part.

You can mix html and asp code in a page that ends with .asp by putting the code between <% and %> tags. e.g. - Save the following code as test.asp and run it on your asp server
<html>
<head>
<title>Demo of how to mix asp and hrml.</title>
</head>
<body>
<p> this is produced by regular html</p>
<%
Response.Write "<p>This is produced by asp code - Server Time is - " & now() & "</p>"
%>
</body>
</html>



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: AyChihuahuas
Date Posted: 26 November 2006 at 11:53pm
So basically to have an ASP counter it would have to be it's own page with a link to it if someone wanted to view how many hits I've had?
 
I came up with a solution anyway... I embedded the asp page (which has only the counter) into my index page with an <iframe> tag.
 
Thanks for the help anyway.
 
- Bill


Posted By: javi712
Date Posted: 27 November 2006 at 3:00pm
It doesn't have to be in its own page. All you would have to do is rename the .html extension of your index page to an .asp extension. Once that's done, you can integrate your asp code into that page and have the browser properly display it.


Posted By: AyChihuahuas
Date Posted: 27 November 2006 at 10:24pm
I understand that I can rename the html page to an asp... The only problem is that I want it on my index page and my index page HAS to be .html or .htm or else it wont display....


Posted By: dpyers
Date Posted: 28 November 2006 at 12:04am
If your web server supports asp, either index.asp or default.asp should work. Usually there's a ordered list of page names/extensions. First on the list takes precedence so if you have both a default.html and a default.asp page, the default.html would display. On iis, default.x takes precedence over index.x by default although that can be overr ridden.

If you're using HSphere control panel, you can turn on indexes for the domain and set your own precedence list that overrides any iis settings.


-------------

Lead me not into temptation... I know the short cut, follow me.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net