|
|
|
<html>
<head>
<title>Bala's Simple PHP Counter</title>
</head>
<body>
<!--
/*
Hai,
This is a very simple counter which uses no database. You can use this counter to keep
track of the number of visitors to your site. This counter uses the simple and time-tested
method of updating a text file(say, acc.txt).
All you have to do is just copy the below code into your index.htm page in the exact
location you wish to display the counter. If you do not wish to display the number of visitors
just remove the following line from the program.
echo "<br>You are the $cnew Visitor to This site";
If you wish to view the number of visitors to different sections of your site just create more
text file (acc1.txt, acc2.txt...) and modify the corresponding file name in the program and
paste the code in the required pages.
You can download the latest version of this counter from
http://www.balakumar.8m.com/mycode/php/counter/balacounter.zip
*/
-->
<!--COPY FROM THIS LINE TO THE 'END COPY' LINE INTO YOUR
'INDEX.HTM' FILE.
YOU CAN PLACE IT IN THE LOCATION YOU WANT THE VISITOR NUMBER
TO BE DISPLAYED
->
<?php
/*
**********************************************************
* *
* Bala's Simple PHP Counter *
*Copyright (c) 1999, Balakumar (somu_balakumar@yahoo.com *
* *
**********************************************************
*
*
*
* This is a very simple counter I have written using
*PHP. This counter can give you the count of visitors to your
*site. As databases are not used, it is very simple to configure
*and use. You can feel free to copy and distribute.
*
* I welcome your sugesstions and comments. Please mail
*me at somu_balakumar@123india.com.
*
*********************************************************
*/
//open the file handler
$fp=fopen("acc.txt","r");
//Read the previous count
$count=fgets($fp,1024);
//close the file.
fclose($fp);
$fw=fopen("acc.txt","w");
//Increment the counter
$cnew=$count+1;
//write the counter back to the log file ie., acc.txt
$countnew=fputs($fw,$count+1);
//Display VISITOR NUMBER
echo "<br>You are the $cnew Visitor to This site";
fclose($fw);
?>
<!--END COPY-->
</body>
</html> |
|
| PHP3: Formmail. Just a cgi formmail, but than in PHP. It is easy to use! Categories : HTML and PHP, Email, PHP, Perl, HTML and PHP | | | PhpView 0.1 - simple php viewer, using temporary files and frames.
Categories : PHP, PHP Options and Info, Debugging, HTML and PHP | | | Reduce PHP/HTML File Sizes Categories : PHP, Compression, HTML and PHP, Zlib | | | Pseudo Non Parsed Header. Output to the the browser as the script runs. Categories : PHP, HTTP, HTML and PHP | | | Simple PHP control CSS Calendar Categories : PHP, HTML and PHP, Calendar, Date Time, CSS | | | Parsing html tags with php. Get an array from this function Categories : PHP, HTML and PHP, Arrays, Tag Extractors | | | Dynamic Calendar in PHP, Javascript and HTML. Categories : PHP, Java Script, HTML and PHP, Calendar | | | Simple Generic Drop Down List Function Categories : PHP, HTML and PHP, Functions | | | DDN FFA Network Script Categories : PHP, MySQL, Complete Programs, HTML and PHP, Databases | | | Opening and formatting text files into HTML on the fly- or HTML from templates. Categories : PHP, HTML and PHP, Filesystem | | | A script to generate a report from a valid mysql connection. The user has to supply which fields he wants to display in table. All properties are changable.
Categories : PHP, PHP Classes, Databases, MySQL, HTML and PHP | | | Browser Detection, Redirection Type, MSIE, MOZILLA, Netscape Navigator, NS, $HTTP_USER_AGENT, HTTP_USER_AGENT Categories : PHP, HTTP, Browsers, HTML and PHP | | | background music script for random notes in a frame Categories : PHP, Content Management, HTML and PHP | | | A very simple way to build and do a hierarchical html categories browser without javascript , just using html php and mySql
Categories : HTML and PHP, Databases, Algorithms, PHP, MySQL | | | Query2Report : Generating Html, Pdf and Csv Reports from SQL Query Categories : PHP, PHP, HTML, PDF, Excel | |
| | | | Ravi Shanker wrote :138
Not a bad scrip for a beginner. And your description
makes all the more easier.
Thanks a lot.
| |
|
|