October 2009
Beginner
408 pages
7h 27m
English
Separating your commenting system separate from the rest of your blog makes it easier to maintain and extend in the future; you'll leverage the object-oriented approach you learned about in Chapter 8 to implement this feature.
Begin by creating a new file that will contain the class. Call this file comments.inc.php, and store it in the inc folder in the simple_blog project (full path: /xampp/htdocs/simple_blog/inc/comments.inc.php).
Once you create the file, you need to declare the class and a constructor for it. This class must be able to read and write from the database, so you need to include the database information stored in db.inc.php.
Your class needs a property to hold the database variable. Your class ...
Read now
Unlock full access