LinksTraffic - Links and traffic exchange system

Reading & Updating a File

english directory french directory
Search: Advanced Search

Reading & Updating a File

Copy and paste the following code into your editor and run it (code comments are included)

If you want to see the live result (we believe this is the best way to learn what is the script about), try it here (new window).

The source code

This example actually updates the file according to a date and a number; if the line contains the current date, it increments the number otherwise it adds another line with the current date.
Everyday a line is then added and a new counter is initiated.

download the file

Notes:
- the file is automatically created if it does not exists (see writing into a file for more details);
- you need to have the necessary permissions to be able to write into a file on your server (see chmod on linux/unix).

You may wish to read additional materials from:
- http://www.php.net/manual/en/function.fgets.php
- http://www.php.net/sscanf

Post a comment

Webmaster Corner

The ClickBnk Code
Another Killer Product From Michael Jones, simply follow the Blueprint For Easy Online Wealth Using Click Bank...

Mass Article Control #1
Create Thousands Of Articles From only 1 Article and Have them Submitted Automatically With A brand New Submitter!

iPowerWeb
Incredible Membership Packages - Web Hosting!

Maverick Money Makers - Get Paid For Life!

Categories

Copyright 2004-2010 @ LinksTraffic RHM Solution ::: Partners | Privacy | Contact us form