/
home
/
u897542709
/
domains
/
zcardin.com
/
public_html
/
Upload File
HOME
<?php require 'config.php'; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $email = $_POST['email']; $stmt = $pdo->prepare("SELECT * FROM AutoUsers WHERE email = ?"); $stmt->execute([$email]); $user = $stmt->fetch(); if ($user) { $token = bin2hex(random_bytes(32)); $expires = date('Y-m-d H:i:s', strtotime('+1 hour')); $stmt = $pdo->prepare("UPDATE AutoUsers SET reset_token = ?, reset_expires = ? WHERE email = ?"); $stmt->execute([$token, $expires, $email]); $reset_link = "https://zcardin.com/reset_password.php?token=$token"; // ارسل الايميل للمستخدم (ده مثال بسيط، الأفضل استخدام SMTP فعلي) mail($email, "Reset your password", "Click this link to reset your password: $reset_link"); echo "Check your email for a reset link."; } else { echo "Email not found."; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Forgot Password - ZCardin</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <style> body { font-family: 'Montserrat', sans-serif; background-color: #f0f2f5; display: flex; justify-content: center; align-items: center; min-height: 100vh; margin: 0; padding: 10px; } .form-container { background: white; padding: 30px 20px; border-radius: 20px; box-shadow: 0 0 15px rgba(0,0,0,0.1); max-width: 400px; width: 100%; } h2 { text-align: center; color: #5a84a2; margin-bottom: 25px; } input[type="email"] { width: 100%; padding: 12px; margin-bottom: 15px; border-radius: 10px; border: 1px solid #ccc; box-sizing: border-box; font-size: 16px; } button { width: 100%; padding: 12px; background-color: #5a84a2; color: white; font-size: 16px; border: none; border-radius: 10px; cursor: pointer; } button:hover { background-color: #456b89; } .link { text-align: center; margin-top: 20px; } .link a { color: #5a84a2; text-decoration: none; font-size: 14px; } @media (max-width: 480px) { .form-container { padding: 20px 15px; } h2 { font-size: 20px; } } </style> </head> <body> <div class="form-container"> <h2>Forgot Password</h2> <form method="post" action=""> <input type="email" name="email" placeholder="Enter your email" required> <button type="submit">Send Reset Link</button> </form> <div class="link"> <a href="login.php">Back to Login</a> </div> </div> </body> </html>