|
|
|
|
![]() ![]() |
May 18 2005, 10:41 AM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 218 Joined: 13-January 05 Member No.: 3,267 |
In this tutorial i will explain how to make a simple script writen in PHP...that uses .txt file.
CODE <?php // script writen by tema $a = fopen ("count.txt", "r"); // 1. $bytes = 4; $x = fread($a, $bytes); // 2. $y=$x + 1; // 3. $fp = fopen ("counter/count.txt", "w+"); // 4. fwrite ($fp, "$y"); // 5. fclose ($fp); // 6. echo "Posjeta:$y"; // 7. ?> 1. selecting a file which the script is going to use for counting visits. 2. reading from the script 3. adding 1 to the number in the .txt file. 4. opening the .txt file again 5. writeing the new number in the .txt file 6. closeing .txt file 7. writing the number from the .txt file ...you have to include this file somewhere on the start page.., here are all the script files...for download http://tema.trap17.com/php/SC-php.rar http://tema.trap17.com/php/SC-php.zip if you have some questions about this script post them here,,,... |
|
|
|
Aug 7 2005, 12:00 PM
Post
#2
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 378 Joined: 13-October 04 From: Slovenia Member No.: 1,731 |
Very nice script, simple one, but there is one workaround needed. Relative path in line 1 and 4 isn't same. I guess we need to delete "counter/". It worked like a charm, needed 3 minutes to install it.
|
|
|
|
Aug 7 2005, 08:42 PM
Post
#3
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 128 Joined: 6-August 05 Member No.: 10,402 |
I don't really undertsand what this does? What does it count? Could you explain please?
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 6th October 2008 - 11:43 PM |