This is my very first php program. My code is not showing error. But it doesn't print out anything. What is wrong with my code. I am trying to fix it but it doesn't work. The program should print out Strong password or Bad passwrod according to user input. Please, someone, help me. Thanks in advance.
<?php
$variable = "";
//Bad Words Dictonary
//Use isset function to check whether a varibale is set or not
if(isset($_POST['submit']))
{
$Badwords=array("test","1234567","help,","password");
$password=$_POST['password']; //declare new variable password and assign to user's password
//if user enter 7 or less character password, the program will warn the user.
if(strlen($password)<8)
{
$variable="Passwrod at least should have 8 or more character";
}
//else the program will check user's password with badwords dictonary
else
{
if(in_array($password, $Badwords))
{
$variable="Your Password is Bad or not Secure!";
}
else
{
$variable="Your Password is Strong!!";
}
}
}
?>
<!DOCTYPE html>
<html>
<title> Pasword Checker </title>
<body>
<!--Create a input text box for passwrod and a button to trigger the action -->
<!--Need to use Form Tag as we need password input to check it -->
<form action="" method="post">
Enter Your Password To Check: <input type="text" name="password" value=""> <br>
<input type="submit" value="submit"><br>
</form>
<p>
<div class="variable">
<?php
echo $variable;
?>
</div>
</p>
</body>
</html>