Solved

Web Counter

Posted on 2004-10-16
2
159 Views
Last Modified: 2010-05-18
Ok, I use FrontPage to build my page, and everytime I have added a web counter it has been handled but my web hoster, but now I am in charge of my job intranet's website, well my sections. And I need to know how to add a web page counter to it. Please help me
0
Comment
Question by:erichss
2 Comments
 
LVL 27

Expert Comment

by:Diablo84
ID: 12330480
If you have PHP available here is a compact example:

<?php
$file = $_SERVER['DOCUMENT_ROOT']."/hitcount.txt";
$len = 6; //numbers to display (for padding)

$count = @file_get_contents($file);
if (empty($count)) $count = 1;
$count = sprintf('%0'.$len.'u', $count);
$handle = fopen($file,"w");
fwrite($handle, $count+1);
fclose($handle);

echo $count;
?>

file extension must be .php
0
 
LVL 4

Accepted Solution

by:
Tagor earned 250 total points
ID: 12334641
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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.
The viewer will learn how to dynamically set the form action using jQuery.
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…

743 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

9 Experts available now in Live!

Get 1:1 Help Now