Lokasi:
/
home
/
u109751622
/
domains
/
swastikass.org
/
public_html
/
Ubah: admin_login.php
<?php session_start(); include 'config.php'; if ($_SERVER['REQUEST_METHOD'] == 'POST') { $username = $_POST['username']; $password = $_POST['password']; $query = "SELECT * FROM admin WHERE username = '$username'"; $result = mysqli_query($conn, $query); $row = mysqli_fetch_assoc($result); if ($row && password_verify($password, $row['password'])) { $_SESSION['admin'] = $username; header("Location: dashboard.php"); exit(); } else { echo "<script>alert('अमान्य उपयोगकर्ता नाम या पासवर्ड।');</script>"; } } ?> <!DOCTYPE html> <html lang="hi"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>लॉगिन</title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"> <style> .login-container { width: 30%; margin: auto; margin-top: 100px; padding: 20px; background: #f8f9fa; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } </style> </head> <body> <div class="container"> <h2 class="text-center mt-5">लॉगिन</h2> <div class="login-container"> <form action="" method="POST"> <div class="mb-3"> <label class="form-label">उपयोगकर्ता नाम</label> <input type="text" name="username" class="form-control" required> </div> <div class="mb-3"> <label class="form-label">पासवर्ड</label> <input type="password" name="password" class="form-control" required> </div> <button type="submit" class="btn btn-primary w-100">लॉगिन करें</button> <div class="text-center mt-3"> <a href="registration.php">रजिस्टर करें</a> </div> </form> </div> </div> </body> </html>
Batal