D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
probwael
/
www
/
Filename :
changepass_update.php
back
Copy
<?php session_cache_expire(120); ini_set('session.gc_maxlifetime', 7200); @session_start(); //--------------- include("conn.php"); $em=$_SESSION["em"]; $pword=$conn->real_escape_string(htmlentities($_POST["pword"],ENT_QUOTES)); $pword1=$conn->real_escape_string(htmlentities($_POST["pword1"],ENT_QUOTES)); $pword2=$conn->real_escape_string(htmlentities($_POST["pword2"],ENT_QUOTES)); $upd=date('d-M-Y h:i:s:a'); if($pword=='' or $pword1=='' or $pword2=='') { $_SESSION["msg"]='<br>font color=red><b>Invalid operation... One or more required inputs missing! </b></font><br><br>'; header("location: changepass"); } else if(mysqli_num_rows(mysqli_query($conn, "select id, email from _register where email='$em' and pword='$pword'"))==0) { $_SESSION["msg"]='<font color=red><b>Invalid current password supplied! </b></font><br><br>'; header("location: changepass"); } else if($pword1!==$pword2) { $_SESSION["msg"]='<br><font color=red><b>Invalid operation... Password confirmation did not match! </b></font><br><br>'; header("location: changepass"); } else { //----update account mysqli_query($conn, "update _register set pword='$pword1' where email='$em'") or die(mysqli_error($conn)); $_SESSION["msg"]='<br><font color=green><b>Password successfully changed! </b></font> <br><br>'; header("location: dashboard"); } ?>