Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Now that your application is properly functioning, modify the PHP portion of the such that if the user enters an incorrect login or password, a

Now that your application is properly functioning, modify the PHP portion of the such that if the user enters an incorrect login or password, a message as such is displayed to the user, via an echo statement. Also, modify the code such that the user will have only three attempts to log into the application. You can accomplish this by declaring a session variable named count that tracks the number of login attempts.

$login_name = "";

$login_password = "";

$success = "";

$error = "";

if ((isset($_POST["myName"]) && isset($_POST["myPassword"]))) {

$login_name = $_POST["myName"];

$login_password = $_POST["myPassword"];

if ($login_name == "sammy" && $login_password == "autumn") {

$url = "http://www.fye.com";

header("Location: $url");

}

}

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

session_start();

ob_start();

if (isset($_SESSION['count']))

$_SESSION['count'] = $_SESSION['count'] + 1;

else

$_SESSION['count'] = 1;

print "count = " . $_SESSION['count'];

if ($_SESSION['count'] <= 3) {

// existing PHP code

}

}

?>

Login Screen

First Name


Password


Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

=+j Describe the various support services delivered by IHR.

Answered: 1 week ago