WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : PHP, simple, counter, bala
Categories : HTML and PHP, PHP, PHP Options and Info Update Picture
Somu Balakumar
Date : Dec 13th 1999
Grade : 3 of 5 (graded 2 times)
Viewed : 16017
File : balacounter.zip
Images : No Images for this code example.
Search : More code by Somu Balakumar
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<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>



PhpView 0.1 - simple php viewer, using temporary files and frames.
Categories : PHP, PHP Options and Info, Debugging, HTML and PHP
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
Website Engine
Categories : PHP, HTML and PHP, Templates
Dynamically generated pop-ups (Select items)
Categories : PHP, HTML and PHP, MySQL, Databases
Vote-Poll script that has a wrapper class that allows the user to create multiple polls on the same page with little trouble.
Categories : PHP, PHP Classes, HTML and PHP
Football News Aggregator
Categories : PHP, Object Oriented, PHP Classes, Rich Site Summary (RSS), HTML and PHP
Complex paging with no resultset limit
Categories : PHP, MySQL, Databases, Output Control, HTML and PHP
Display Slashdot headers on your own site
Categories : HTML and PHP, HTML, PHP
Customizable Calendar Class
Categories : HTML and PHP, Date Time, PHP, PHP Classes, Calendar
Real simple example of removing HTML tags from text then changing \n (new line) to <br>. Could be used in a forum for instance.
Categories : HTML, PHP, HTML and PHP, Beginner Guides
PHP alternating the colors of table rows with style.
Categories : PHP, HTML and PHP, CSS
PHP function which gets all the data from a webpage into a string, we can perform regular expression functions on that data afterwards to get our desired data.
Categories : PHP, URLs, HTML and PHP
phpFormGenerator for Dynamic Form Generation from MySQL
Categories : PHP, PHP Classes, MySQL, Databases, HTML and PHP
Sql Builder
Categories : PHP, HTML and PHP, Databases, General SQL, Form Processing
Step by Step installation manual for PHP4.1.x on Windows 2000 based systems running IIS5 using CGI or ISAPI
Categories : PHP, PHP Configuration, PHP Options and Info, Windows 2000
 Ravi Shanker wrote :138
Not a bad scrip for a beginner. And your description 
makes all the more easier.
Thanks a lot.