$strErrormessage .= "Please enter new password<br>"; $intError = 0; } if (trim($_POST["cpass"]) == "") { $strErrormessage .= "Please enter confirm password<br>"; $intError = 0; } if (trim($_POST["newpass"]) != trim($_POST["cpass"])) { $strErrormessage .= "New password and confirm password does not match<br>"; $intError = 0; } if (strlen(trim($_POST["newpass"])) < 4) { $strErrormessage .= "Password should be atleast 4 character long<br>"; $intError = 0; } $intCheck = $hldGlobal->fnCheckUserOldPass(trim($_POST["oldpass"]), $_POST["id"]); if (!$intCheck) { $strErrormessage .= "Old password does not match<br>"; $intError = 0; } if ($intError) { $sqlUpd = "UPDATE tbluser SET password='******' WHERE id=" . $_POST["id"]; mysql_query($sqlUpd) or die(mysql_error()); header("Location:changepassword.php?er=1"); } } if (!$intError) { $hdlTpl->setVariable("emessage", $strErrormessage); //Assigns message $hdlTpl->parse("error_blk"); }