Question

In: Computer Science

Create a web form that will accept a string as a password and determine the strength...

Create a web form that will accept a string as a password and determine the strength of that password. The strength of a password is determined by the characters making up the password. These characters are divided into three categories:

USING PHP

The uppercase characters, which are A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z The lowercase characters, which are a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
The special characters which are ~!@#$%^&*()_?+><

The strength of the password can be:

  • INVALID : if the string is less than 8 characters long or has invalid characters

  • POOR: if the string contains only one set of the above characters in it

  • MEDIUM: if the string contains only two sets of the above characters in it

  • GOOD: if the string contains all three sets of the above characters.

    T

  • Strength Message should display “INVALID”, “POOR”,”MEDIUM” or “GOOD”.

    For “INVALID”, “POOR” or ”MEDIUM” strengths give the reason(s) why. The Reason

is less than 8 characters”,
does not contain uppercase characters”
does not contain lowercase characters”
does not contain special characters”
does not contain uppercase or lowercase characters” does not contain uppercase or special characters” does not contain lowercase or special characters” contains uppercase, lowercase and special characters” contains invalid characters”

  • “Password

  • “Password

  • “Password

  • “Password

  • “Password

  • “Password

  • “Password

Message can be:

“Password

“Password

Solutions

Expert Solution

HTML page :

<html>
<body>

<form action="validate_password.php" method="post">
Password: <input type="password" name="password">
<input type="submit">
</form>

</body>
</html>

PHP code (validate_password.php):

<?php

$password = $_POST["password"]
$uppercase = preg_match('@[A-Z]@', $password);
$lowercase = preg_match('@[a-z]@', $password);
$special_chars = preg_match('/[^a-zA-Zd]/', $password);

$length = strlen($password);
if ($length < 8)
{
   echo "INVALID. Reason is less than 8 characters";
}
elseif ($uppercase && $lowercase && $special_chars)
{
    echo "GOOD";
}
elseif ($uppercase && $lowercase)
{
    echo "MEDIUM. Reason is does not contain special characters";
}
elseif ($uppercase && $special_chars)
{
    echo "MEDIUM. Reason is does not contain lowercase characters";
}
elseif ($lowercase && $special_chars)
{
    echo "MEDIUM. Reason is does not contain uppercase characters";
}
elseif (!$uppercase && !$special_chars)
{
    echo "POOR. Reason is does not contain uppercase and special characters";
}

elseif (!$uppercase && !$lowercase)
{

    echo "POOR. Reason is does not contain uppercase and lowercase characters";
}

elseif (!$lowercase && !$special_chars)
{
    echo "POOR.   Reason is does not contain lowercase and special characters";
}

else{

    echo "GOOD";

}

?>

PLEASE THUMBS UP!!!!!


Related Solutions

Is there a simple way to create a username and password for a registeration form? The...
Is there a simple way to create a username and password for a registeration form? The username should be between 4 and 20 characters. The password should be between 4 and 12 characters, contain at least one digit, and contain at least one uppercase and one lowercase character. Select four special characters and require that the password contain at least one of them.
•Write a JAVA program to check a given password strength from a user's input. •Create a...
•Write a JAVA program to check a given password strength from a user's input. •Create a method to check the number of characters. It must be more than 8. •Create a method to check the password to have at least one uppercase letter. •Create a method to check the password to have at least one lowercase letter. •Create a method to check the password to have at least one digit. •Create a method to check the password to have at...
•Write a JAVA program to check a given password strength from a user's input. •Create a...
•Write a JAVA program to check a given password strength from a user's input. •Create a method to check the number of characters. It must be more than 8. •Create a method to check the password to have at least one uppercase letter. •Create a method to check the password to have at least one lowercase letter. •Create a method to check the password to have at least one digit. •Create a method to check the password to have at...
Responsive web form: Create a well laid out responsive contact me web form saved as index.html...
Responsive web form: Create a well laid out responsive contact me web form saved as index.html with the following labeled fields: First name, last name, company name, email address, phone number, and comments, submit button Validate the form so that the required fields are First name, Last name, and email address. Once validated, write the data to a results page saved as results.html. The web pages must automatically switch between device types or browser sizes or screen resolutions. Text size,...
Write a recursive method to determine if a String is a palindrome. Create a String array...
Write a recursive method to determine if a String is a palindrome. Create a String array with several test cases and test your method. Write a recursive method to determine if a String is a palindrome. Create a String array with several test cases and test your method. In Java
Write a Java method to check whether a string is a valid password. Password rules: A...
Write a Java method to check whether a string is a valid password. Password rules: A password must have at least ten characters. A password consists of only letters and digits. A password must contain at least two digits. There are at least SIX functions/methods as the following: 1. menu() – to print the password’s rules. 2. getString() – to get the password from the user. 3. isPassword() – to check either the password is valid based on the given...
I need to create a web page(JAVASCRIPT) that allows the user to reverse a string. For...
I need to create a web page(JAVASCRIPT) that allows the user to reverse a string. For Example, if the user types Mirror Image, after the button is clicked, the text will say egamI rorriM.You have to implement each button by using a while, do while and for loop. here is a default code <html> <head>    <title>Mirror</title> </head> <body>    <p id="label1">Original Text: <h1 id="text1">Some text goes here!!!</h1></p>    <p id="label2">Mirror Text: <h1 id="text2">!!!ereh seog txet emoS</h1>    <input type="button"...
In C++ Create two functions called TheNumber. One version of TheNumber should accept a string and...
In C++ Create two functions called TheNumber. One version of TheNumber should accept a string and output the accepted string 10 times. The other version of TheNumber should accept a double and output the accepted double 10 times. This uses function overloading.
Python Coding Create function openAndReturnLastN() to meet the conditions below - accept 2 parameters; 1 string...
Python Coding Create function openAndReturnLastN() to meet the conditions below - accept 2 parameters; 1 string (name of a file) and 1 integer (N) - add a docstring - use exception handling techniques to attempt to open the filename provided, if it does not exist, return False - the file will contain an unknown number of lines - store the last N lines of the file in a single string var - return the resultant string var --- ensure to...
Python create a function tryhard and print out the dictionary as a string form. For example...
Python create a function tryhard and print out the dictionary as a string form. For example def tryhard(d:dict): #Code here input: d = {'first': {}, 'second': {'1': {'move'}, '0': {'move', 'slow'}}, 'third': {'1': {'stop'}}} output = " first movie: [ ]\n third movie: [('1', ['stop'])]\n second movie: [('0', ['slow', 'move']), ('1', ['move'])]\n"
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT