Geekpedia Tutorials Home

Building a C# Chat Client and Server

Building a C# Chat Client and ServerA step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.

in C# Programming Tutorials

Getting Hard Drive Information

Getting Hard Drive InformationA C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.

in C# Programming Tutorials

UPS Shipping Calculator

UPS Shipping CalculatorThis tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.

in PHP Programming Tutorials

Create Your Own Rich Text Editor

Create Your Own Rich Text EditorCreating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.

in JavaScript Programming Tutorials
Search
Tutorials
Programming Tutorials
IT Jobs
From CareerBuilder

Basic Hit Counter In PHP

A very basic hit counter in PHP; it uses a text file to store the number of hits and displays the number of current hits.

On Friday, October 17th 2008 at 01:11 PM
By Andrew Pociu (View Profile)
*****   (Rated 5 with 2 votes)
Contextual Ads
More PHP Resources
Advertisement
  1. if (gethostbyaddr($_SERVER['REMOTE_ADDR']))
  2. {
  3.    $CntFile = "HitCounter.txt";
  4.    $Hits = file($CntFile);
  5.    $CurrHits = $Hits[0]++;
  6.    $FileHandle= fopen($CntFile, "w"); // Open as a writable file
  7.    fputs($FileHandle, $CurrHits);
  8.    fclose($FileHandle);
  9.    echo "Hits: ".number_format($CurrHits);
  10. }
Digg Digg It!     Del.icio.us Del.icio.us     Reddit Reddit     StumbleUpon StumbleIt     Newsvine Newsvine     Furl Furl     BlinkList BlinkList

Rate Rate this code snippet
Comment Current Comments
by free2step.com on Saturday, February 14th 2009 at 05:38 AM

thanks for the help - www.free2step.com

by dfd on Friday, May 7th 2010 at 08:59 AM

ekdom baje

by Shoaib on Sunday, June 20th 2010 at 01:35 AM

dear,

i want to know how we can see demo before using code in our file,

man to say i view many website related source codes but they have additional option (view demo).
overall your website is too good but if you add this option than it was really great.



Comment Comment on this tutorial
Name: Email:
Message:
Comment Related Source Code
There is no related code.

Comment Related Tutorials
There are no related tutorials.

Jobs PHP Job Search
My skills include:

Enter a City:

Select a State:


Advanced Search >>
Sponsors
Discover Geekpedia

Other Resources