For this project, do Case Project 11-1 on page 577 of the text. Note, you must develop 2 php files for this project. The first is a class called HitCounter.php and the second is a file called CountVisits.php. The CountVisits file will be the one used by the user and it will instantiate an instance of the HitCounter class. The HitCounter class takes care of opening the database file and table and obtaining the current number of hits, placing that number in a private variable. That private variable is accessible in the object by calling the "get" function. Before terminating, the CountVisits program has to set the new value using the "set" function (in the class definition, the "set" function should increment the current counter by one and update the database). Note that part of the constructor function in HitCounter.php should be to check to see if your table exists and then create it, if it does not, and initialize the table with values.
We are sharing a database, so you will need to make sure that the table you create and use for this program is name correctly. The name of your table should be 4530-p5-username, where "username" is your EIU username. For example, if your EIU username is btclown, then your table for this project will be called 4530-p5-btclown. The database access information is the same as in Project 4. The only thing different is the name of the table you will use.
If you want to test your program creating a table and need to delete your table to test, use the Database Table Management Utility to delete your table.
If you are not familiar with object-oriented programming, this project may be difficult for you. Begin early and use the forum to get questions answered. Note: To receive credit for this project, it MUST be done using an object instantiated from a class AND you must use a table in your database. Other approaches will not be considered (there are, obviously, other ways to create hit counters).
The project is due no later than 9:00 a.m. on the date specified in the course calendar. Late assignments will not be accepted. Also, I will give no help for this project on the day it is due, so although there is time before class on that day, it cannot be used for assistance on this project.
Hints