🚀 Hostinger Optimized
🖥️ Server: LiteSpeed
💻 System: Linux in-mum-web1643.main-hosting.eu 5.14.0-611.42.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 24 05:30:20 EDT 2026 x86_64
👤 User: u621169360 (621169360)
🐘 PHP: 8.2.30
🚫 Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail

💻 Terminal

📁 /home/u621169360/domains/agriexpertt.com/public_html/wp-admin
$

📄 login.php

📁 Path: /home/u621169360/domains/agriexpertt.com/public_html/mobile/Flutter/login.php
📊 Size: 1.31 KB
🔒 Perm: 0644
📝 MIME: text/x-php
<?php

// Enable CORS headers
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST");
header("Access-Control-Allow-Headers: Content-Type");


require_once 'db.php';

// Retrieve the username and password from the POST request
$username = $_POST['username'];
$password = $_POST['password'];

// Encrypt the password using MD5
$encryptedPassword = md5($password);

// Query the database to check if credentials match
$query = "SELECT * FROM users WHERE user_phone = :username AND user_password = :password AND status = 'Active'";
$stmt = $pdo->prepare($query);
$stmt->bindParam(':username', $username);
$stmt->bindParam(':password', $encryptedPassword);
$stmt->execute();
$user = $stmt->fetch(PDO::FETCH_ASSOC);

if ($user) {
    // Valid credentials
    $response = [
        'success' => true,
        'message' => 'Login successful',
        'user_phone' => $user['user_phone'],
        'user_name' => $user['user_name'],
      	'user_email' => $user['user_email'],
      	'user_district' => $user['user_district'],
      
        'id' => $user['id'],
    ];
} else {
    // Invalid credentials
    $response = [
        'success' => false,
        'message' => 'Invalid username or password',
    ];
}

// Send the response as JSON
header('Content-Type: application/json');
echo json_encode($response);
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨