OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
knoblyExpressLandingPage
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/09/2025 11:18:49 AM
rwxr-xr-x
📄
about.php
2.06 KB
08/20/2024 11:17:08 AM
rw-r--r--
📁
assets
-
08/20/2024 11:17:08 AM
rwxr-xr-x
📄
blog.php
5.35 KB
08/20/2024 11:17:08 AM
rw-r--r--
📁
cream
-
09/23/2024 04:31:51 AM
rwxr-xr-x
📄
dashboard.php
788 bytes
08/20/2024 11:17:08 AM
rw-r--r--
📄
db.php
378 bytes
08/20/2024 11:17:08 AM
rw-r--r--
📄
footer.html
3.76 KB
08/20/2024 11:17:08 AM
rw-r--r--
📄
forgot-password-handler.php
2.13 KB
08/20/2024 11:17:08 AM
rw-r--r--
📄
forgot-password.php
4.52 KB
08/20/2024 11:17:08 AM
rw-r--r--
📁
includes
-
08/20/2024 11:17:08 AM
rwxr-xr-x
📄
index.php
5.94 KB
08/20/2024 11:17:08 AM
rw-r--r--
📄
login-handler.php
869 bytes
08/20/2024 11:17:08 AM
rw-r--r--
📄
login.php
4.72 KB
08/20/2024 11:17:08 AM
rw-r--r--
📄
navbar.php
830 bytes
08/20/2024 11:17:08 AM
rw-r--r--
📄
refundPolicy.php
5.99 KB
08/20/2024 11:17:08 AM
rw-r--r--
📄
reset-password-handler.php
910 bytes
08/20/2024 11:38:06 AM
rw-r--r--
📄
reset-password.php
2.95 KB
08/21/2024 05:04:57 AM
rw-r--r--
📄
service.php
4.29 KB
08/20/2024 11:17:08 AM
rw-r--r--
📄
signup-handler.php
1.04 KB
08/20/2024 11:17:08 AM
rw-r--r--
📄
signup.php
5.98 KB
08/20/2024 11:17:08 AM
rw-r--r--
📄
usagePolicy.php
15.21 KB
08/20/2024 11:17:08 AM
rw-r--r--
Editing: forgot-password-handler.php
Close
<?php // This is a basic example, and should be enhanced with security measures. // Ensure you have configured your email server settings. use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'vendor/autoload.php'; // Include Composer autoload include 'db.php'; if ($_SERVER["REQUEST_METHOD"] == "POST") { $email = mysqli_real_escape_string($conn, $_POST['forgotEmail']); $sql = "SELECT * FROM users WHERE email='$email'"; $result = $conn->query($sql); if ($result->num_rows > 0) { $user = $result->fetch_assoc(); $resetToken = bin2hex(random_bytes(32)); $resetTokenExpiry = date('Y-m-d H:i:s', strtotime('+1 hour')); $updateSql = "UPDATE users SET reset_token='$resetToken', reset_token_expiry='$resetTokenExpiry' WHERE email='$email'"; if ($conn->query($updateSql) === TRUE) { $mail = new PHPMailer(true); try { $mail->isSMTP(); $mail->Host = 'smtp.example.com'; // Set your SMTP server $mail->SMTPAuth = true; $mail->Username = 'your_email@example.com'; // SMTP username $mail->Password = 'your_password'; // SMTP password $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->setFrom('your_email@example.com', 'Knobly Xpress'); $mail->addAddress($email); $mail->isHTML(true); $mail->Subject = 'Password Reset Instructions'; $mail->Body = 'Click <a href="https://yourdomain.com/reset-password.php?token=' . $resetToken . '">here</a> to reset your password. The link will expire in 1 hour.'; $mail->send(); echo 'Password reset instructions have been sent to your email.'; } catch (Exception $e) { echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo; } } else { echo "Error updating record: " . $conn->error; } } else { echo "No user found with this email."; } } $conn->close(); ?>