Check out my twitter script by CMXads
Evil gear Christmas is almost here | Sell your soul Believeth in me an hath everlasting life | Goth and Gore Gifts Shop right now or else! | Till death do us part Axels New Music releases |
here are some of the best and useful php scripts and snippets to help in your projects. Php displayed below. Use the search for specific script lookups. Click the category links to view scripts in Javascript and cgi. To add your own script click the link and add your useful script example.
Text file hit counter using both fopen and wriye as well as
file get and put contents example couter scripts
<?php
$counter = file_get_contents("counter.txt"); $counter++; file_put_contents("counter.txt", $counter|LOCK_EX); echo $counter;
?>
Or a graphic hit counter:
<?php
$counter = file_get_contents("counter.txt"); $counter++; file_put_contents("counter.txt", $counter); for($i = 0; $i < strlen($counter); $i++) echo "<img src=\"counter/".substr($counter, $i, 1).".gif\" alt=\"".substr($counter, $i, 1)."\" />";
?>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
<?php
// your content here...
$filename = '/path/to/counter.txt'; // our counter file
$fp = fopen( $filename,"r"); // open it for READING ("r")
$counter = fread($fp, filesize($filename) ); // read in value
fclose( $fp ); // close it whilst we work
++$counter; // increase the counter by one
print "$counter hits to this page"; // print out the new value
$fp = fopen( $filename,"w"); // open it for WRITING ("w")
fwrite( $fp, $counter); // write in the new value
fclose( $fp ); // close it
?>