korsygfhrfggfhfgfffgffg6655665dtggggggzangaiide
Elehhjhjjkjkfpf6df56fd65ffff
/
home2
/
sunpublicschools
/
public_html
/
SunShine_AdMin
/
Upload FileeE
HOME
<?php include 'header.php'; ?> <div class="content-wrapper"> <div class="page-title"> <div> <p><i class="fa fa-key"></i> Change Password</p> </div> </div> <?php if(isset($_POST["submit_change"])){ $password = md5($_POST["password"]); $newpassword = md5($_POST["newpassword"]); $confirmnewpassword = md5($_POST["confirmnewpassword"]); $qry="SELECT password FROM webadmin WHERE password='".$password."' "; $queryget = mysqli_query($connect,$qry); $row = mysqli_fetch_array($queryget); $oldpassword = $row["password"]; //check passwords if ($password == $oldpassword) { //check two new passwords if ($newpassword == $confirmnewpassword) { $sql="Update webadmin set password='" . $confirmnewpassword . "' WHERE password='" . $password . "' "; $final = mysqli_query($connect,$sql); echo '<div class="alert alert-success msg" role="alert" style="margin-top: 100px;">Password Updated Successfully</div>'; } else { echo '<div class="alert alert-success msg" role="alert" style="margin-top: 100px;">Not Matched</div>'; } } else { echo '<div class="alert alert-success msg" role="alert" style="margin-top: 100px;">Please fill the correct existing Password</div>'; } } ?> <form name="frmChange" method="post" action="" onSubmit="return validatePassword()" > <div class="card"> <div class="row"> <div class="col-md-4"> <label>Old Password<span class="mand_star">*</span></label> <input type="password" class="form-control" name="password"> <span id="password" class="required"></span> </div> <div class="col-md-4"> <label>New Password<span class="mand_star">*</span></label> <input type="password" class="form-control" name="newpassword"> <span id="newpassword" class="required"></span> </div> <div class="col-md-4"> <label>Confirm Password<span class="mand_star">*</span></label> <input type="password" class="form-control" name="confirmnewpassword"> <span id="confirmnewpassword" class="required"></span> </div> </div> <div class="row"> <div class="col-md-12"> <input type="submit" class="btn btn-warning vadhu_btn" value="Submit" name="submit_change"> </div> </div> </div> </form> </div> </div> <!-- Javascripts--> <script src="js/jquery-2.1.4.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/plugins/pace.min.js"></script> <script src="js/main.js"></script> <script> function validatePassword() { var password,newpassword,confirmnewpassword,output = true; password = document.frmChange.password; newpassword = document.frmChange.newpassword; confirmnewpassword = document.frmChange.confirmnewpassword; if(!password.value) { password.focus(); document.getElementById("password").innerHTML = "Required"; output = false; } else if(!newpassword.value) { newpassword.focus(); document.getElementById("newpassword").innerHTML = "Required"; output = false; } else if(!confirmnewpassword.value) { confirmnewpassword.focus(); document.getElementById("confirmnewpassword").innerHTML = "Required"; output = false; } if(newpassword.value != confirmnewpassword.value) { newpassword.value=""; confirmnewpassword.value=""; newpassword.focus(); document.getElementById("confirmnewpassword").innerHTML = "Not Same"; output = false; } return output; } </script> <style> input { font-family:Arial; font-size:14px; } .message { color: #FF0000; text-align: center; width: 100%; } .txtField { padding: 5px; border:#fedc4d 1px solid; border-radius:4px; } .required { color: #FF0000; font-size: 14px;; font-weight:italic; padding-left:10px; } </style> </body> </html>