The goal of this project is to learn server-side web programming using PHP and a relational database system (MySQL). More specifically, you will create a message board where registered users can post messages.
This project must be done individually. No copying is permitted. Note: We will use a system for detecting software plagiarism, called Moss, which is an automatic system for determining the similarity of programs. That is, your program will be compared with the programs of the other students in class as well as with the programs submitted in previous years.
Note that, if you use a Search Engine to find similar programs on the web, we will find these programs too. So don't do it because you will get caught and you will get an F in the course (this is cheating). Don't look for code to use for your project on the web or from other students (current or past). Just do your project alone using the help given in this project description and from your instructor and GTA only. Finally, you should not post your code nor deploy your project on a public web site.
As in the previous projects, you will develop this project on your PC/laptop using XAMPP and you will test it using using your Mozilla Firefox web browser. Download project4.zip and unarchive the files inside your web server document root directory. The project4 directory contains the file createDB.sql, which contains the SQL description of the tables: users and posts, that have the following schema:
users ( username, password, fullname, email ) posts ( id, replyto, postedby, datetime, message )Primary keys: users.username and posts.id.
The project4 directory contains the file board.php that uses the PDO extension of PHP to insert a new user and to query the users table using MySQL.
Please read The PHP Data Objects (PDO) extension, especially the PDO class.
You need to write two PHP scrips login.php and board.php. The login.php script generates a form that has two text windows for username and password and a "Login" button. The board.php has a "Logout" button, a textarea to write a message, a "New Post" button, and a list of messages. The board script prints all the messages in the database as a flat list ordered by date/time (newest first, oldest last). Note: messages should not be organized based on their replyto attributes. For each posted message, it prints:
Each Reply button must have an action that submits the form to board.php with a different replyto value.
You may use a form button
with type="submit" and formaction="board.php?replyto=12345" to reply to a message with ID 12345.
Use md5 to encode passwords in PHP. Use uniqid to generate a unique id in PHP. Use the MySQL function now() to return the current date and time.
Zip your project4 directory and use the form below to submit your project4.zip file. We do not accept email or hardcopy submissions. You may submit multiple files, if you like, as long as they have different names. After you submit the files, please double-check that your submitted files are correct by clicking on the Status link.
Last modified: 03/08/2016 by Leonidas Fegaras