Specifications
Storing Bookmarks
To store a user’s bookmarks, we will need to set up some space in our MySQL database. We
will need the following functionality:
• Users should be able to retrieve and view their bookmarks.
• Users should be able to add new bookmarks. We should check that these are valid URLs.
• Users should be able to delete bookmarks.
Again, we can write functions for each of these pieces of functionality.
Recommending Bookmarks
We could take a number of different approaches to recommending bookmarks to a user. We
could recommend the most popular or the most popular within a topic. For this project, we are
going to implement a “like minds” suggestion system that looks for users who have a book-
mark the same as our logged-in user, and suggests their other bookmarks to our user. To avoid
recommending any personal bookmarks, we will only recommend bookmarks stored by more
than one other user.
We can again write a function to implement this functionality.
Solution Overview
After some doodling on napkins, we came up with the system flowchart shown in Figure 24.1.
Building Practical PHP and MySQL Projects
P
ART V
500
Login page
Registration
Forgot
Password?
View BMs
Logout
Change
password
RecommendDelete BMAdd BM
FIGURE 24.1
This diagram shows the possible paths through the PHPBookmark system.
30 7842 ch24 3/6/01 3:34 PM Page 500










