📁 File Manager
🏠 /
/
home
/
u857492117
/
domains
/
mangaldaicollege.org
/
public_html
/
dk1
/
admin
Dosya Düzenle: admin_login.php
<?php session_start(); include("../config.php"); $error = ''; if ($_SERVER['REQUEST_METHOD'] == 'POST') { $email = $_POST['email']; $password = $_POST['password']; // Check admin credentials $res = mysqli_query($conn, "SELECT * FROM admin_users WHERE email='$email' AND password='$password'"); if (mysqli_num_rows($res) == 1) { $admin = mysqli_fetch_assoc($res); $_SESSION['admin_id'] = $admin['admin_id']; $_SESSION['admin_name'] = $admin['name']; header("Location: index.php"); exit; } else { $error = "Invalid email or password."; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Admin Login</title> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet"> <style> body { font-family: 'Poppins', sans-serif; background: linear-gradient(135deg, #2575fc, #6a11cb); display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .container { background: white; padding: 40px; border-radius: 12px; width: 350px; box-shadow: 0 10px 20px rgba(0,0,0,0.2); text-align: center; } h2 { color: #6a11cb; margin-bottom: 20px; } input { width: 100%; padding: 12px; margin: 10px 0; border-radius: 8px; border: 1px solid #ccc; } button { width: 100%; background: #2575fc; color: white; border: none; padding: 12px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.3s; } button:hover { background: #6a11cb; } .error { color: red; margin-bottom: 10px; } </style> </head> <body> <div class="container"> <h2>Admin Login</h2> <?php if($error) echo "<p class='error'>$error</p>"; ?> <form method="post"> <input type="email" name="email" placeholder="Email" required> <input type="text" name="password" placeholder="Password" required> <button type="submit">Login</button> </form> </div> </body> </html>
💾 Kaydet
İptal