Counters Code

  Home arrow Counters Code arrow Counter
COUNTERS CODE

Counter
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2002-07-28

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement
    A simple to setup,simple to use, simple hit counter.

    By : Gunblade

    Very simple PHP text based counter.
    to use it simple add this code to your html.
    <script language="javascript" src="http://yourdomain.com/counter.php"></script>
    Simply add the below code into a notepad document and save it as counter.php

    Then upload counter.php to ouyr directory in ascii mode.

    -----Beginning of Script-----
    <?
    $log="counter.txt"; //counter log file.
    //nothing else to change leave it as is.

    $open=@fopen($log,'r+');
    $counter=@fread($open,filesize($log));
    @fclose($open);
    $counter++;
    $write=fopen($log,'w');
    fputs($write,$counter);
    fclose($write);
    echo "document.write($counter)";
    ?>



    -----End Of Script-----

    note:

    if you want to change your counter number from 1 to any just create or change
    counter.txt to proper counts and upload to your directory.
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Counters Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    COUNTERS CODE ARTICLES

    - TG Who's Online
    - Text Based Counter that formats output
    - Counter & visitor statistics
    - Server Uptime Statistics
    - Chris Dingman's Hit Tracker Script
    - Graph Maker Function
    - Simple userOnline class
    - Adv. Log file generator
    - Logwriter
    - time_left()
    - Basic Statistics
    - Easy Counter
    - countCodeLines
    - MySQL Counter
    - bandwidthmeter

    Developer Shed Affiliates

     



    © 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap