26163Reading and Writing Fileshttp://www.phpnerds.com/article/reading-and-writing-filesDatabases really are wonderful pieces of software, they allow us to organize our content logically and allow easy access, updating and searching. However, sometimes a database is overkill and is not needed for the task. For example, what if you had a list of sayings or quotes, and you would like to display a random one each time the page loads. This could easily be represented in a database; however, it is equally as easy to do it using flat filesPHP > Tips and Tutorials > File ManipulationOct 15, 2006Peter McNulty
In the previous version of this tutorial I only covered how to paginate a flat file based application. In this updated version, I will discuss some improvements along with pagination for database content as well (specifically, MySQL). I will also cover how to retain any pre-existing query string variables that your application might be using without interfering with our pagination.
Databases really are wonderful pieces of software, they allow us to organize our content logically and allow easy access, updating and searching. However, sometimes a database is overkill and is not needed for the task. For example, what if you had a list of sayings or quotes, and you would like to display a random one each time the page loads. This could easily be represented in a database; however, it is equally as easy to do it using flat files
It is common to have downloads on your website, and sometimes you want to moderate your downloads by speed, or possibly hide the directory that the download is coming from, protecting all your other files. This is very possible and very simple to solve in PHP. All you need is the header() function and some files function
This is the simple example to list contents of any Directory. To do this we are going to define function DirDisply( ) which will read the current directory contents and display it as a list.
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.