File manager - Edit - /home/autoph/public_html/tasks/passwordRecovery.php.tar
Back
home/autoph/public_html/aee/passwordRecovery.php 0000644 00000006374 15025011517 0016131 0 ustar 00 text/x-generic PasswordRecoveryService.php ( PHP script, ASCII text ) <?php date_default_timezone_set('Asia/Manila'); header('Content-Type: application/json'); $sqlUser = 'autoph_arnel'; $sqlDatabase = 'autoph_mva'; $sqlPass = 'Hke@2001'; $toDate = date_create() ->format("Y-m-d"); // for viewing date only $myDate ="As of ".$toDate; $TokenExpirationDate = date('Y-m-d', strtotime($toDate. ' + 1 days')); $conn = mysql_connect($sqlHost, $sqlUser, $sqlPass) or die ("Couldn't connct to MySQL server on $sqlHost: ". mysql_error(). '.'); $db = mysql_select_db($sqlDatabase, $conn) or die ("Couldn't select database $sqlDatabase: ". mysql_error(). '.'); $RequestKey= $_REQUEST['RequestKey']; $userName= $_REQUEST['userName']; $userEmail= $_REQUEST['userEmail']; $token = md5($toDate."-".$userName); //echo $token; //if($RequestKey==10240911070721200106222015){ $did_something === 0; $return_news = Array(); $chkIfExist = mysql_result(mysql_query("SELECT COUNT(`u_id`) FROM vts_users WHERE u_name ='$userName' AND `email`= '$userEmail'"),0); if($chkIfExist > 0){ $getRegisteredEmail = mysql_result(mysql_query("SELECT `email` FROM vts_users WHERE u_name ='$userName' AND `email`= '$userEmail'"),0); $getRegisteredFname = mysql_result(mysql_query("SELECT `u_fname` FROM vts_users WHERE u_name ='$userName' AND `email`= '$userEmail'"),0); $getRegisteredUID = mysql_result(mysql_query("SELECT `u_id` FROM vts_users WHERE u_name ='$userName' AND `email`= '$userEmail'"),0); // the message $msgBox = "Hi ".$getRegisteredFname."! Please click/copy this link to your browser to reset your password. https://autohub.ph/connect/home/password_reset.php?Token=".$token."&username=".$userName." From ASA Admin"; // use wordwrap() if lines are longer than 70 characters // $msg = wordwrap($msg,70); //Save entry $sql = "INSERT INTO password_recovery (id, record_id,token, date_requested, date_expire) VALUES('', '$getRegisteredUID','$token','$toDate','$TokenExpirationDate')"; $sqlQuery = mysql_query($sql, $conn) or die("Couldn't perform query $sql (".__LINE__."): " . mysql_error() . '.'); // send email $from = "support@autohub.ph"; $to = $userEmail; $subject = "ASA Passowrd Reset Request"; $msgBox = "Hi ".$getRegisteredFname."! Please click/copy this link to your browser to reset your password. https://autohub.ph/connect/home/password_reset.php?Token=".$token."&username=".$userName." From ASA Admin"; $headers = "From:" . $from; mail($to,$subject,$msgBox, $headers); $did_something === 1; $json = json_encode(["Message" =>"Instruction on how to reset your password has been sent to your registered e-mail address.", "TokenExpiraton"=>"False"]); } else{ $json = json_encode(["Message" =>"Sorry, the information you provided doesn't match any of our records. Please double check your Username and registered e-mail address", "TokenExpiraton"=>"True"]); } //} if($did_something === 0) { $json = json_encode(["Message" =>"Sorry, the information you provided doesn't match any of our records. Please double check your Username and registered e-mail address", "TokenExpiraton"=>"True"]); }else{ echo $json; } echo $msg; ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings