Llamasery.com Home  
 
Server-side Starter Tutorial: Text Files - Part 1 of 4
Alfie the alpha_geek: Llamasery guru-in-waiting Tutorials Purpose

Starter Tutorials

Tell-a-Friend
Tell-a-Friend +
The 'Contact Form'
php Includes
Simple Themes
MySQL database 101
Comments System
Text Files

Intermediate Material

Articles/Tutorials

Text Files

Text files make the world go round!! Why? Because every html page, every php page, etc., that appears in your browser is a text file - either interpreted by your browser, or pre-interpreted by your server. And one of the nice things about text files is that all you need to edit them is a text editor.

On a more constructive note, what can you do with a text file? Read from it, write to it, and so forth. Which means that you could actually use a text file as a database. Which is exactly what a lot of early php free scripts did (and still do) for users who do not have access to a database on their site's server. At present, virtually all web hosting companies that offer php also include MySQL along with it. If your web host doesn't, or they actually expect you to pay money for MySQL, then switch hosting companies!

So assuming that your web host provides a real database, and you use that for database operations, what could you do with a text file? Nothing that you couldn't do with a database, except that some applications really are too simple to want to go to the trouble of creating a database table, using a database administration program to access it, etc. If you really, really, want to learn how to manipulate text files in a 'real' database application, then you're not going to find it here [in the starter tutorials].

Instead, we'll show you two small applications of text files - a visit counter, and a tiny, tiny, database you can edit with a text editor.

  next  »