I have following code:
<fieldset>
<p>
<label>Password*</label>
<input type="password" placeholder="Password" name="pswd" id="psd"/>
<label>Confirm Password*</label>
<input type="password" name="cpswd" placeholder=" retype Password" id="cpsd" />
<label class="obinfo">* obligatory fields</label>
</p>
</fieldset>
<?php
$pwd = $_POST['pswd'];
if (preg_match("#.*^(?=.{8,20})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).*$#", $pwd))
{
echo "Your password is good.";
}
else
{
echo "Your password is bad.";
}
?>
Presently code just checks if password is good(strong) or not . It is giving error Undefined index pswd. I am a newbie in this regard. I do not know much about javascript or jQuery. Is there a way we can check the password strength and see if they are matching using php? Also do let me know way to print all the messages in the form itself. Thanks in advance.