session_start(); //$account = $_GET['account']; //$userid = $_SESSION['userid']; //if (!isset($_SESSION['userid'])){ //header("location:login.php");//if session is not registered takes you back to index.php //} $userid = $_POST['userid']; if ($userid == "") { $userid = $_GET['account']; } //include "include/session.php"; include "include/z_db.php"; // database connection details stored here ////////////////////////////// if ($_POST['userid'] == "" && $_GET['userid'] == "") { print ""; } //$userid = $_SESSION['userid']; //if ($userid == "") //{ //$userid = $_GET['userid']; //} $query="SELECT * FROM plus_signup WHERE userid = '$userid'"; $st=mysqli_query($link,$query); $recs=mysqli_num_rows($st); $row=mysqli_fetch_object($st); //$rec = mysqli_fetch_array($query); //$em=$row->email;// email is stored to a variable //$userid=$row->userid; $sec_temp=$row->sec; $pass_temp=$row->password; $email=$row->email; if ($email=="" || $sec_temp=="") { print ""; } if ($recs == 0) { print ""; } if ($_POST['submit1'] == "Reset Password") { if ($_POST['password'] <> $_POST['password2'] || $_POST['password'] == "") { print ""; $match = "NOTOK"; }else{ $match = "OK"; } //$userid = $_POST['userid']; //$sec = strtolower($_POST['sec']); if ($_POST['sec_temp'] != strtolower($_POST['sec'])) { print ""; $secure = "NOTOK"; }else{ $secure = "OK"; } $password = sha1($_POST['password']); if ($password == $pass_temp) { print ""; $pass = "NOTOK"; }else{ $pass = "OK"; } if ($match == "OK" && $secure == "OK" && $pass == "OK") { $result = mysqli_query($link,"UPDATE plus_signup SET password='$password' WHERE userid='$userid'") or die(mysqli_error()); } if(mysqli_affected_rows($link) == 1) { print ""; } elseif (mysqli_affected_rows($link) == 0) { $msg = "