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: reset_password.php
<?php // admin/reset_password.php include 'secure_session.php'; // public page (no auth.php) require_once '../config.php'; // DB + BASE_URL // TEMP: better error visibility while testing (remove later) ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $token = $_GET['token'] ?? ''; $id = isset($_GET['id']) ? (int)$_GET['id'] : 0; $showForm = false; $error = ''; $success = ''; if ($token && $id > 0) { $hashedToken = hash('sha256', $token); $stmt = $conn->prepare("SELECT id FROM register WHERE id=? AND reset_token=? AND reset_expires > NOW() LIMIT 1"); $stmt->bind_param("is", $id, $hashedToken); $stmt->execute(); $stmt->bind_result($foundId); $stmt->fetch(); $stmt->close(); if (!empty($foundId)) { $showForm = true; } else { $error = "This reset link is invalid or has expired."; } } else { $error = "Invalid request."; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { $id = (int)($_POST['id'] ?? 0); $token = $_POST['token'] ?? ''; $pass = $_POST['password'] ?? ''; $confirm = $_POST['confirm'] ?? ''; if (strlen($pass) < 8) { $error = "Password must be at least 8 characters."; } elseif ($pass !== $confirm) { $error = "Passwords do not match."; } else { $hashedToken = hash('sha256', $token); $stmt = $conn->prepare("SELECT id FROM register WHERE id=? AND reset_token=? AND reset_expires > NOW() LIMIT 1"); $stmt->bind_param("is", $id, $hashedToken); $stmt->execute(); $stmt->bind_result($foundId); $stmt->fetch(); $stmt->close(); if (!empty($foundId)) { $passwordHash = password_hash($pass, PASSWORD_DEFAULT); $stmt = $conn->prepare("UPDATE register SET password=?, reset_token=NULL, reset_expires=NULL WHERE id=?"); $stmt->bind_param("si", $passwordHash, $id); $stmt->execute(); $stmt->close(); $success = "✅ Password updated. You can now log in."; $showForm = false; } else { $error = "This reset link is invalid or has expired."; } } } ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Reset 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;--err:#fff0f0;--errb:#f0b2b2} body{font-family:system-ui,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);margin:0;padding:24px} .card{max-width:440px;margin:48px auto;background:var(--card);border-radius:16px;box-shadow:0 6px 24px rgba(0,0,0,.08);padding:24px} h1{font-size:22px;margin:0 0 10px} .msg{margin:12px 0;padding:12px;border-radius:10px} .ok{background:var(--ok);border:1px solid var(--okb)} .err{background:var(--err);border:1px solid var(--errb)} label{display:block;margin-top:12px;font-weight:600} input[type=password]{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} </style> </head> <body> <div class="card"> <h1>Set a New Password</h1> <?php if ($error): ?> <div class="msg err"><?= htmlspecialchars($error) ?></div> <?php endif; ?> <?php if ($success): ?> <div class="msg ok"><?= htmlspecialchars($success) ?></div> <a href="./login.php">← Back to Login</a> <?php endif; ?> <?php if ($showForm): ?> <form method="post" autocomplete="off"> <input type="hidden" name="id" value="<?= (int)$id ?>"> <input type="hidden" name="token" value="<?= htmlspecialchars($_GET['token'] ?? '') ?>"> <label>New Password</label> <input type="password" name="password" required minlength="8"> <label>Confirm Password</label> <input type="password" name="confirm" required minlength="8"> <button type="submit">Update Password</button> </form> <?php endif; ?> </div> </body> </html>
Upload File
Create Folder