Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Basic Content Create the following folder structure in your htdocs folder ( or the csis 2 4 4 0 folder, if you created one, in
Basic Content
Create the following folder structure in your htdocs folder or the csis folder, if you created one, in your htdocs folder
spies
js
img
css
includes
Download the fbi.txt fileskinnergatekeepercsmaliendanaskepticfoxbeliever fbi.txt file and place it into the includes folder.
Create the following files on your computer in the spies folder:
index.php
In the index.php file:
Create a standard web page with all the basics doctype html tag, head tag, body, etc.
In the body of the page, create a web form using the post that asks for the user username and password.
be sure to use a "password" input rather than a "text" input for the password field
be sure to include a reset button
be sure to include a submit button
once submitted one of two things will happen:
The PHP file will check to see if the username is "chuck" and the password is "roast"
If they enter the correct userpassword the page will say "access granted" and will display the contents of the above mentioned text file
Note, the PHP code must read the file and display its contents in an HTML table using file reading techniques.
Hint: you may have to explode more than once.
If they enter the wrong credentials the form will display with a message above it that says "access denied"
See sample screen shots below
Give the site some personality using CSS
Think about design and layout
Be sure to do all of your styling in a CSS file that is linked to your index.php file
Test the site:
Make sure that your test is with correct and incorrect credentials and verify the site response accordingly
Make sure that you CSS works correctly
Upload the site:
Once the site has been tested, upload the spies directory to your server in the htdocs folder on your server.
Test the site again once it's uploaded and live
Notes:
All of the PHP and HTML code will be in the index.php file. There will be no other files.
When the form is processed, it will reload the index.php displaying different content depending on the results of the form input.
You must use the file reading techniques described in the "Reading Files" lecture see the "Related Lectures" section above and no other file reading techniques ie don't use filegetcontents
Advanced Content
In the real world, a real programmer has to be good at researching online. The Advanced Content section is meant to prepare you for that. Below is a list of a few items that purposely aren't fully or at all covered in the lectures videos. The intent is to get you used to the idea of taking what you know and branching out through a little bit of research online, just like in the real, postschool, world. :
Use the PHP documentationLinks to an external site. and as a secondary source WSchoolsLinks to an external site..
Correctly implement the following items on your page:
Modify the input to accept an additional usernamepassword combo of user: bob and password: ross ie both bobross AND chuckroast will have access
Once logged in allow the user to choose to view either the fbi.txt file Download fbi.txt file or this one: spies.txt Download spies.txt whichever one they want. Note: spies.txt when displayed will be the same layout format as the when viewing the fbi.txt file see "Sample Screenshots" below
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started