Solved

Can I call an asp function from an html page?

Posted on 2015-01-07
6
111 Views
Last Modified: 2015-01-08
Hi,

This is probably a really stupid question, however, I'm not very familiar with ASP. Is there any way that I can use an ASP function to count the number of hits to an html page, and display those results on a separate page? I don't want to have a visual hit counter, so I was going to display the results on a separate page. Someone told me I would have to convert the html page to an asp page in order for it to work. Is that correct? Is there any other way I could do it? I can't use 3rd party systems to gather the info.
0
Comment
Question by:savache27
6 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40536173
If you want to count the hits, then all you need to do is keep the counts in a file or database table on the server and update it for every page request, For the display pag you just read the file or query the DB for the values.

Cd&
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40536175
That is correct.  HTML by itself does not support any kind of programming except for javascript in the browser.  The server logs usually keep track all accesses so if you can find a log program that will process your server logs, you can find the info there.
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 40536194
it would make your life that much easier to use some kind of server side language, such as classic asp, that way you can easily connect to a database on your server and store the info there. You could look into client side data storage, but that could get complicated if you're not familiar with the concept.

I found this tutorial that may help get you going in the right direction. It basically collects a lot of user stats, you could extract just the pieces you need for just a hit counter.

http://classicaspreference.com/aspexamples/classic_asp_track_visitors.asp
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 33

Accepted Solution

by:
paulmacd earned 500 total points
ID: 40536267
"I can't use 3rd party systems to gather the info."
This is a shame, because Google Analytics would be the easiest way to do something like this.  If you mean you can't use a third-party product on the Internet, consider Piwik, which can be installed on your own network, so you have complete control over it.

If you really can't use a third-party solution, you could create a second web site that DOES use ASP/ASP.Net, then include a reference to a page on the the ASP site from the HTML site.  Every time a page on the HTML site loads, it calls the ASP site and the ASP site registers the hit.  The ASP site can record the name of the calling page and update a database to keep track of the page, date/time, etc.
0
 

Author Closing Comment

by:savache27
ID: 40538853
Thanks for all the responses. I ended up creating an ASP page and included a reference to it from the HTML page like paulmacd suggested.
0
 
LVL 33

Expert Comment

by:paulmacd
ID: 40538861
Thanks for the points.  Happy to help.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Jquery oncheck to update SPAN 31 56
Swiper slider stops between pages 11 32
Select2 jquery help 9 46
Detecting robots? 5 34
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now