Course Hero Logo

forgotpassword.php - ?php if isset $ POST update {...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 2 out of 2 pages.

<?phpif(isset($_POST['update'])){$email=$_POST['email'];$mobile=$_POST['mobile'];$newpassword=md5($_POST['newpassword']);$sql ="SELECT EmailId FROM tblusers WHERE EmailId=:email and ContactNo=:mobile";$query= $dbh -> prepare($sql);$query-> bindParam(':email', $email, PDO::PARAM_STR);$query-> bindParam(':mobile', $mobile, PDO::PARAM_STR);$query-> execute();$results = $query -> fetchAll(PDO::FETCH_OBJ);if($query -> rowCount() > 0){$con="update tblusers set Password=:newpassword where EmailId=:email andContactNo=:mobile";$chngpwd1 = $dbh->prepare($con);$chngpwd1-> bindParam(':email', $email, PDO::PARAM_STR);$chngpwd1-> bindParam(':mobile', $mobile, PDO::PARAM_STR);$chngpwd1-> bindParam(':newpassword', $newpassword, PDO::PARAM_STR);$chngpwd1->execute();echo "<script>alert('Your Password succesfully changed');</script>";}else {echo "<script>alert('Email id or Mobile no is invalid');</script>";}}?><script type="text/javascript">function valid(){if(document.chngpwd.newpassword.value!= document.chngpwd.confirmpassword.value){alert("New Password and Confirm Password Field do not match!!");document.chngpwd.confirmpassword.focus();return false;}return true;}</script><div id="forgotpassword" class="modal fade"><div class="modal-dialog modal-xl"><div class="modal-content">

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 2 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
Sheila
Tags
Return statement

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture