I l @ ve RuBoard |
To truly take your Web applications to the next level, you'll need a method of storing and retrieving data. E-commerce sites, Internet portals, and template-driven content providers all make use of writing and reading information to the server. There are two primary ways of storing data with PHP: using files (and directories) or databases. In this chapter, I will discuss the former, and in the next chapter, I will introduce the latter. It is worth your time to comprehend both methods . At the very least, there are two benefits to using files and directories to store data instead of databases: one, they don't require knowledge of databases (a complicated subject), and, two, most Web hosts charge extra for database access with your account, whereas file access is a given. While a database will inevitably be more powerful than a file-based system, you may be surprised at how much you can do just sending and retrieving information from simple text documents on the server! In this chapter, you'll learn about file permissions, then learn to: write to and read from files; create directories; handle file uploads from an HTML form; and, perform other common tasks with both files and directories (renaming, deleting, etc.). |
I l @ ve RuBoard |