Go Back   CodingForums.com > :: Server side development > PHP > Post a PHP snippet

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-26-2005, 11:43 PM   PM User | #1
Element
Regular Coder

 
Element's Avatar
 
Join Date: Jul 2004
Location: Lynnwood, Washington, US
Posts: 855
Thanks: 2
Thanked 2 Times in 2 Posts
Element is an unknown quantity at this point
Cool Hit Counting

Well... this just won't do. Every site has to have a hit counter snippet. xD I guess I'll have to throw one in.

PHP Code:
<?php

          
if (gethostbyaddr($_SERVER['REMOTE_ADDR']) != null) {
             
$counterDB "hits.dat";
             
$hits file($counterDB);
             
$current $hits[0]++;
             
$handle fopen($counterDB "w");
             
fputs($handle $current);
             
fclose($handle);
             echo  
'<b>Hits: '.number_format($current).'</b>';
          } 

?>
Element is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:41 AM.


Advertisement
Log in to turn off these ads.