🤩 File Manager - Mr.X
PHP:
8.3.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:login.php
<?php require_once __DIR__ . '/../config/config.php'; require_once __DIR__ . '/../includes/functions.php'; header('Content-Type: application/json'); if ($_SERVER['REQUEST_METHOD'] != 'POST') { echo json_encode(['success'=>false,'message'=>'Invalid request']); exit; } $email = cleanInput($_POST['email']); $password = $_POST['password']; $stmt = $conn->prepare("SELECT * FROM customers WHERE email = ? AND status = 1"); $stmt->bind_param("s", $email); $stmt->execute(); $customer = $stmt->get_result()->fetch_assoc(); if ($customer && password_verify($password, $customer['password'])) { $_SESSION['customer_id'] = $customer['id']; $_SESSION['customer_name'] = $customer['name']; $_SESSION['customer_email'] = $customer['email']; addActivityLog('login', "Customer {$customer['name']} logged in", 'customer', $customer['id']); echo json_encode(['success'=>true,'message'=>'Login successful!','redirect'=>SITE_URL . 'customer/dashboard.php']); } else { echo json_encode(['success'=>false,'message'=>'Invalid email or password']); }
Save Changes
Cancel
Create New File
Create New Folder