File manager - Edit - /home/gppowercontrol/public_html/forget-password.php
Back
<!doctype html> <html class="no-js" lang=""> <head> <?php include "include/head.php"; isNotLogin(); if (isset($_POST['submit'])) { $email = mysqli_real_escape_string($con, $_POST['email']); $query = "SELECT * FROM user WHERE email='$email'"; $result = mysqli_query($con, $query); if (mysqli_num_rows($result) > 0) { $token = bin2hex(random_bytes(50)); $expiry = date("Y-m-d H:i:s", strtotime("+1 hour")); $update = "UPDATE user SET reset_token='$token', reset_token_expiry='$expiry' WHERE email='$email'"; mysqli_query($con, $update); $resetLink = "https://gppowercontrol.com/reset-password.php?token=$token"; $subject = "Password Reset Request"; $message = "Click the link below to reset your password:\n\n$resetLink\n\nLink expires in 1 hour."; $headers = "From: noreply@gppowercontrol.com"; mail($email, $subject, $message, $headers); echo "<script>alert('Password reset link sent to your email');</script>"; } else { echo "<script>alert('Email not found');</script>"; } } ?> </head> <body> <?php include "include/header.php" ?> <div class="breadcurb-area"> <div class="container"> <ul class="breadcrumb"> <li class="home"><a href="index.php">Home </a></li> <li> Forgot Password </li> </ul> </div> </div> <div class="my-account-area" style="background: #ffcda9;"> <div class="container"> <div class="row justify-content-center"> <div class="col-lg-12 align-item-center"> <div class="page-title"> <h2>Forgot Password</h2> </div> </div> </div> <div class="row justify-content-center"> <div class="col-lg-6 col-md-6 "> <form method="post" class="resestered-customers customer"> <div class="customer-inner"> <div class="user-title"> <h2><i class="fa fa-file-text"></i>Forgot Password</h2> </div> <div class="account-form"> <div class="form-horizontal product-form"> <div class="form-goroup"> <label>Email Address <sup>*</sup></label> <input type="text" name="email" required="required" class="form-control"> </div> </div> </div> </div> <div class="user-bottom fix"> <div class="user-bottom-inner"> <button class="btn custom-button" type="submit" name="submit" >Send Reset Link</button> </div> </div> </form> </div> </div> </div> </div><!-- End My Account Area --> <?php include "include/footer.php" ?> <?php include "include/foot.php" ?> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.59 |
proxy
|
phpinfo
|
Settings