Solved

Web Counter

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VMware virtualization clustering 5 25
XML problem with Internet Explorer 7 40
website file permissions 4 65
What language/protocol is the Angular Chat? 2 57
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

12 Experts available now in Live!

Get 1:1 Help Now