<?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 users WHERE email='$email' LIMIT 1"); if($q && mysqli_num_rows($q)){ $u=mysqli_fetch_assoc($q); if(password_verify($pass,$u['password_hash'])){ $_SESSION['user_id']=$u['id']; $_SESSION['user_name']=$u['name']; redirect('account.php?lang='.$lang); }} $err='Invalid login'; } include 'includes/header.php'; ?><main class="container"><form class="auth-card" method="post"><h2><?php echo e(t('login_signup')); ?></h2><?php if(isset($err))echo '<p style="color:red">'.e($err).'</p>'; ?><input name="email" type="email" placeholder="Email" required><input name="password" type="password" placeholder="Password" required><button class="primary-btn">Login</button><p><a href="register.php?lang=<?php echo e($lang); ?>">Create account</a></p></form></main><?php include 'includes/footer.php'; ?>
