| only for RuBoard - do not distribute or recompile |
After some doodling on napkins, we came up with the system flowchart shown in Figure 24.1.
We'll build a module for each box on this diagram—some will need one script and others, two. We'll also set up function libraries for
User authentication.
Bookmark storage and retrieval.
Data validation.
Database connections.
Output to the browser. We'll confine all the HTML production to this function library, ensuring that visual presentation is consistent throughout the site. (This is the function API approach to separating logic and content.).
We'll also need to build a back-end database for the system.
We'll go through the solution in some detail, but all of the code for this application can be found on the CD-ROM in the chapter24 directory. A summary of included files is shown in Table 24.1.
We will begin by implementing the MySQL database for this application as it will be required for virtually all the other functionality to work.
Then we will work through the code in the order it was written, starting from the front page, going through the user authentication, to bookmark storage and retrieval, and finally to recommendations. This order is fairly logical—it's just a question of working out the dependencies and building first the things that will be required for later modules.
Note
For the code in this project to work as written, you will need to have switched on magic quotes. If you have not done this, then you will need to addslashes() to data being inserted to the MySQL database, and stripslashes() from data retrieved from the database. We have used this as a useful shortcut.
| only for RuBoard - do not distribute or recompile |