Pahelp naman po di po kase nag lumalabas yung message ano po kaya ang problema dito sa codes ko?
Create a PHP program using the OOP approach that will evaluate if the inputted (use Web Form) password is valid or not. The valid minimum password is eight characters. (USE METHOD POST)
source code:
Create a PHP program using the OOP approach that will evaluate if the inputted (use Web Form) password is valid or not. The valid minimum password is eight characters. (USE METHOD POST)
source code:
PHP:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Password</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
<p>Enter password: <input type="text" name="password" required></p>
<input type="submit" value="Submit" name="validate">
</form>
<?php
$password = $_POST['password'];
class validation{
protected $vPass;
public $msg;
public function __construct($pass){
$this->vPass = $pass;
}
public function validated(){
if(strlen($this->vPass) < 8){
$this->msg = "The password should be 8 characters";
}
else{
$this->msg = "Valid password!";
}
}
}
$val_pass = new validation($password);
echo $val_pass->validated();
?>
</body>
</html>