Authentication is the key

computer science exercise and need the explanation and answer to help me learn.

You need to implement a web application that is split into three parts, namely, Webpage, PHP, and MySQL
Your application should have at least 3 different PHP pages: login.php (for database credentials), users’ sign-in and sign-up on one page, and home page (with an option to log-out). You should use Session and/or Cookie appropriately.
Each of them will be used concurrently to implement the logic described below
Remember to implement such logic in the most secure way to your knowledge
Implement a PHP function that reads in inputs a string from the user and stores it in a table (e.g., in a field called “Thread Name”)
The function should be able to read the content of a file and store it in a table (e.g., in a field called “File Content”)
The web application should be able to implement the logic to log in and sign up users
Each user will have exclusive access to their uploaded material
When a user logs in, only their private content will be displayed on the web page. However, only the first 2 lines per file are printed in output. To show the rest of the content, the authenticated user will need to click a button (E.g. “Expand”).
If no user has logged in yet, no information from the database is printed on the webpage
The user must be able to upload a text file (no other format!)
The user must be able to input a string, using a text box, for “Thread Name”
The webpage allows users to input their credentials for both logging in and signing up (there is no need to validate password, such as password must contain more than 6 characters, at least a number, a lower case, an upper case, retype password during sign up, etc. However, you will need to validate username during sign-up to ensure username is unique in the database)
You can use either “HTTP Authentication”, or “HTML inputs through POST method”
After a user logs in, the webpage prints in output their personal material from the database, that is, the content of each file with the specified name
A button per each file (or all) will be implemented on the webpage to show the remaining lines (after the first 2)
If there is no material yet, nothing is shown for that specific user
After logging in, the user is redirected to the home page.
(Optional) If you have separate log-in and sign-up pages:
The user is redirected to the main page (“First page”) after logging in
The user is redirected to the sign-in page after signing up. Also, the user will have the option to redirect themselves to the sign-in page. And vice versa, the user will have the option to redirect themselves to the sign-up page from the sign-in page
The user is redirected to the log-in page after logging out
You need to create a database that contains at least two tables. One to store the information in input to the webpage, the other to store the user’s credentials
You will need to submit the CREATE TABLE SQL commands choosing the best possible data types
You need to submit your web application in .php files
You need to submit your “CREATE TABLE” SQL command per each table in the Database, with the data type of each field (in any format, such as .txt, .html, .pdf, etc.)
You need to submit your ‘login.php’ file too
You need to submit sufficient screenshots showing before and after signing up, logging in, logging out, file uploading, “Expand” button, etc.
Requirements: N/A

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *