<?php require_once '../includes/bootstrap.php'; if($_SERVER['REQUEST_METHOD']=='POST'){ $email=mysqli_real_escape_string($conn,$_POST['email']); $pass=$_POST['password']; $q=mysqli_query($conn,"SELECT * FROM admins WHERE email='$email' LIMIT 1"); if($q && mysqli_num_rows($q)){ $a=mysqli_fetch_assoc($q); if(password_verify($pass,$a['password_hash'])){ $_SESSION['admin_id']=$a['id']; redirect('index.php'); }} $err='Invalid login'; } ?><!doctype html><html><head><meta charset="utf-8"><link rel="stylesheet" href="../assets/css/style.css"></head><body><form class="auth-card" method="post"><h2>Admin Login</h2><p>Default: admin@tariq.test / 123456</p><?php if(isset($err))echo '<p style="color:red">'.$err.'</p>'; ?><input name="email" type="email" placeholder="Email"><input name="password" type="password" placeholder="Password"><button class="primary-btn">Login</button></form></body></html>
