Solved

Web Counter

Posted on 2004-10-16
2
163 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Suggested Solutions

Title # Comments Views Activity
Problem to run file 9 130
SP to delete duplicates 15 74
Problem to page 4 99
Make Line Items Look Good Over Mobile 2 99
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.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

685 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