Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create the following folder structure in your htdocs folder on your computer: insecure js img css includes Download the users.txt file and place it into
- Create the following folder structure in your htdocs folder on your computer:
- insecure
- js
- img
- css
- includes
- insecure
- Download the users.txt file and place it into the includes folder.
- Create the following file(s) on your computer in the insecure 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 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:
- If they enter the correct user/password (one of the ones from the text file) the page will say "access granted" and will have no other content.
- 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 all of the correct credentials from the text file
- Test it with correct users, but wrong passwords
- Test it with wrong users, but correct passwords
- Test is with wrong users and wrong passwords
- Make sure that you CSS works correctly
- Upload the site:
- Once the site has been tested, upload the insecure 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.
- When the form is processed, it will reload the index.php displaying different content depending on the results of the form input.
Helpful Hints
Below are a few hints that may help you along your journey
- You'll likely need to use the explode() function twice. Once to grab the user/password pair. Then again to separate the user and password individually
- Consider creating an associative array that uses the username for the index/key and the password for the value. Then loop through that array when processing the form.
- The string ||>><<|| separates each user/password pair
- Each user/password pair has a comma between the username and password
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