X7ROOT File Manager
Current Path:
/home/u126090504/domains/kiitacademy.in/public_html/admin
home
/
u126090504
/
domains
/
kiitacademy.in
/
public_html
/
admin
/
📁
..
📄
achievers.php
(8.99 KB)
📄
admissions.php
(5.67 KB)
📄
banners.php
(5.47 KB)
📄
change_password.php
(3.54 KB)
📄
contacts.php
(3.83 KB)
📄
dashboard.php
(8.71 KB)
📄
downloads.php
(4.91 KB)
📄
export_franchise.php
(930 B)
📄
faculty.php
(9.92 KB)
📄
forgot_password.php
(3.75 KB)
📄
franchise.php
(7.28 KB)
📄
gallery.php
(3.08 KB)
📁
includes
📄
index.php
(82 B)
📄
login.php
(6.59 KB)
📄
logout.php
(102 B)
📄
manage_albums.php
(2.28 KB)
📄
manage_media.php
(3.02 KB)
📄
manage_photos.php
(5.66 KB)
📄
manage_videos.php
(3.62 KB)
📄
new_password.php
(3.9 KB)
📄
notices.php
(8.24 KB)
📄
payments.php
(15.23 KB)
📄
popup.php
(10.68 KB)
📄
reset_password.php
(4.23 KB)
📄
secure_session.php
(1000 B)
📄
settings.php
(5.21 KB)
📄
testimonials.php
(10.25 KB)
📄
update_status.php
(1.29 KB)
📄
upi_settings.php
(1.52 KB)
Editing: forgot_password.php
<?php // admin/forgot_password.php include 'secure_session.php'; // public page — auth.php include mat karo require_once '../config.php'; // DB + BASE_URL + MAIL_FROM $notice = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $email = trim($_POST['email'] ?? ''); $notice = "✅ If that email exists, a reset link has been sent."; if ($email !== '') { // 🔄 ANY user (no usertype filter) $stmt = $conn->prepare("SELECT id FROM register WHERE email = ? LIMIT 1"); $stmt->bind_param("s", $email); $stmt->execute(); $stmt->bind_result($uid); $found = $stmt->fetch(); $stmt->close(); if ($found && $uid) { // Create secure token $token = bin2hex(random_bytes(32)); $hashedToken = hash('sha256', $token); $expires = date('Y-m-d H:i:s', strtotime('+1 hour')); // Save token $stmt = $conn->prepare("UPDATE register SET reset_token=?, reset_expires=? WHERE id=?"); $stmt->bind_param("ssi", $hashedToken, $expires, $uid); $stmt->execute(); $stmt->close(); // Build link $link = rtrim(BASE_URL, '/') . "/admin/reset_password.php?token={$token}&id={$uid}"; // Send email (simple) $subject = "Password Reset – KIIT Academy"; $message = "Hello,\n\nClick the link below to reset your password (valid for 1 hour):\n{$link}\n\n" . "If you didn't request this, please ignore this email."; $from = defined('MAIL_FROM') ? MAIL_FROM : 'no-reply@kiitacademy.in'; $fromNm = defined('MAIL_FROM_NAME') ? MAIL_FROM_NAME : 'KIIT Academy'; $headers = "From: {$fromNm} <{$from}>\r\nReply-To: {$from}\r\n"; $ok = @mail($email, $subject, $message, $headers); // Fallback log (in case mail() is blocked) if (!$ok) { @file_put_contents(__DIR__ . '/../mail_fallback.log', date('c') . " TO={$email} LINK={$link} [mail() FAILED]\n", FILE_APPEND); } } } } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Forgot Password – KIIT Academy</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> :root{--bg:#f6f8fb;--card:#fff;--pri:#1a73e8;--ok:#e8fff2;--okb:#b2f0c0} *{box-sizing:border-box} body{font-family:system-ui,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);margin:0;padding:24px} .card{max-width:520px;margin:48px auto;background:var(--card);border-radius:16px;box-shadow:0 6px 24px rgba(0,0,0,.08);padding:24px} h1{font-size:24px;margin:0 0 10px} p.muted{color:#666;margin:0 0 16px} .msg{background:var(--ok);border:1px solid var(--okb);padding:12px;border-radius:10px;margin-bottom:12px} label{display:block;margin-top:12px;font-weight:600} input[type=email]{width:100%;padding:12px;border:1px solid #ddd;border-radius:10px} button{margin-top:16px;width:100%;padding:12px;border:0;border-radius:12px;background:var(--pri);color:#fff;font-weight:700;cursor:pointer} a{display:inline-block;margin-top:12px;color:#5b3fc3} </style> </head> <body> <div class="card"> <h1>Forgot Password</h1> <p class="muted">Enter your email to get a reset link.</p> <?php if ($notice): ?> <div class="msg"><?= htmlspecialchars($notice) ?></div> <?php endif; ?> <form method="post" autocomplete="off"> <label>Email</label> <input type="email" name="email" required> <button type="submit">Send Reset Link</button> </form> <a href="./login.php">← Back to Login</a> </div> </body> </html>
Upload File
Create Folder