|
Server : LiteSpeed System : Linux terra.hostitbro.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64 User : outerorb ( 1091) PHP Version : 8.1.34 Disable Function : mail Directory : /home2/outerorb/.trash/login/ | |
|
Path: /home2/outerorb/.trash/login/auth.php
Size: 1.19 KB
Permissions: 0644
<?php
session_start();
include 'db_conn.php';
if (isset($_POST['email']) && isset($_POST['password'])) {
$email = $_POST['email'];
$password = $_POST['password'];
if (empty($email)) {
header("Location: login.php?error=Email is required");
}else if (empty($password)){
header("Location: login.php?error=Password is required&email=$email");
}else {
$stmt = $conn->prepare("SELECT * FROM users WHERE email=?");
$stmt->execute([$email]);
if ($stmt->rowCount() === 1) {
$user = $stmt->fetch();
$user_id = $user['id'];
$user_email = $user['email'];
$user_password = $user['password'];
$user_full_name = $user['full_name'];
if ($email === $user_email) {
if ($password == $user_password) {
$_SESSION['user_id'] = $user_id;
$_SESSION['user_email'] = $user_email;
$_SESSION['user_full_name'] = $user_full_name;
header("Location: index.php");
}else {
header("Location: login.php?error=Incorect User name or password&email=$email 1");
}
}else {
header("Location: login.php?error=Incorect User name or password&email=$email");
}
}else {
header("Location: login.php?error=Incorect User name or password&email=$email");
}
}
}