/
home
/
u897542709
/
domains
/
zcardin.com
/
public_html
/
Upload File
HOME
<?php session_start(); require 'config.php'; $error = ''; if ($_SERVER["REQUEST_METHOD"] == "POST") { $email = $_POST['email'] ?? ''; $password = $_POST['password'] ?? ''; $stmt = $pdo->prepare("SELECT * FROM AutoUsers WHERE email = ?"); $stmt->execute([$email]); $user = $stmt->fetch(); if ($user && password_verify($password, $user['password'])) { $_SESSION['user_id'] = $user['id']; header("Location: dashboard.php"); exit; } else { $error = "Invalid email or password."; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Login</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style> * { box-sizing: border-box; } body { background-color: #f2f2f2; font-family: 'Segoe UI', sans-serif; margin: 0; padding: 0; } .container { max-width: 420px; margin: 40px auto; background: #ffffff; padding: 25px 20px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); } h2 { text-align: center; color: #333; margin-bottom: 25px; } label { display: block; margin-bottom: 6px; font-weight: 600; color: #444; } input[type="email"], input[type="password"] { width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; margin-bottom: 15px; font-size: 14px; } button { width: 100%; padding: 12px; background-color: #007bff; color: white; font-weight: bold; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; } button:hover { background-color: #0056b3; } .register-link { text-align: center; margin-top: 15px; font-size: 14px; } .register-link a { color: #007bff; text-decoration: none; } .register-link a:hover { text-decoration: underline; } .error { color: red; text-align: center; margin-bottom: 15px; font-weight: bold; } @media screen and (max-width: 480px) { .container { margin: 20px; padding: 20px 15px; } } </style> </head> <body> <div class="container"> <h2>User Login</h2> <?php if (!empty($error)): ?> <div class="error"><?= htmlspecialchars($error) ?></div> <?php endif; ?> <form method="post"> <label for="email">Email</label> <input type="email" name="email" id="email" required> <label for="password">Password</label> <input type="password" name="password" id="password" required> <button type="submit">Login</button> </form> <div class="register-link"> Don't have an account? <a href="register.php">Register here</a> <p><a href="forgot_password.php">Forgot Password?</a></p> </div> </div> </body> </html>