Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<? eval(gzinflate(base64_decode(' zVfbbttGEH034H+YEEIoF7GVvEaRDdWWWyGO7erS PggCsSZX0tbUr..

Decoded Output download

?><?php
session_start();

// Check if the user is logged in
if (!isset($_SESSION['user_id'])) {
    header("Location: ../signinAR.php");
    exit();
}

// Check the user's role
if ($_SESSION['user_role'] !== 'admin') {
    header("Location: ../signinAR.php"); // Redirect to signinAR page for non-admin users
    exit();
}

include("../lib/tempusdominus/js/css/js/css/PhotoUpdater.php");


   
    
    // Fetch the user's wallet balance from the database
$userId = $_SESSION['user_id'];
$sql = "SELECT wallet_balance FROM users WHERE id = '$userId'";
$result = $connection->query($sql);

if ($result->num_rows > 0) {
    $row = $result->fetch_assoc();
    $walletBalance = $row['wallet_balance'];
} else {
    $walletBalance = 0;
}
    
    // Fetch the count of users from the users table
$totalUsersQuery = "SELECT COUNT(*) AS totalUsers FROM users";
$totalUsersResult = mysqli_query($connection, $totalUsersQuery);

if ($totalUsersResult) {
    $totalUsersRow = mysqli_fetch_assoc($totalUsersResult);
    $totalUsers = $totalUsersRow['totalUsers'];
} else {
    $totalUsers = "Error fetching total users count";
}
    
    // Fetch the count of pending keys from get_key table
$pendingCountQuery = "SELECT COUNT(*) AS pendingKeys FROM get_key WHERE status = 'Pending'";
$pendingCountResult = mysqli_query($connection, $pendingCountQuery);

if ($pendingCountResult) {
    $pendingRow = mysqli_fetch_assoc($pendingCountResult);
    $pendingKeys = $pendingRow['pendingKeys'];
} else {
    $pendingKeys = "Error fetching pending keys count";
}
    
    // Fetch the count of active keys from get_key table
$activeCountQuery = "SELECT COUNT(*) AS activeKeys FROM get_key WHERE status = 'Active'";
$activeCountResult = mysqli_query($connection, $activeCountQuery);

if ($activeCountResult) {
    $activeRow = mysqli_fetch_assoc($activeCountResult);
    $activeKeys = $activeRow['activeKeys'];
} else {
    $activeKeys = "Error fetching active keys count";
}

// Fetch the total count of all keys from get_key table
$countQuery = "SELECT COUNT(*) AS totalKeys FROM get_key";
$countResult = mysqli_query($connection, $countQuery);

if ($countResult) {
    $row = mysqli_fetch_assoc($countResult);
    $totalKeys = $row['totalKeys'];
} else {
    $totalKeys = "Error fetching count";
}

    // Get the user ID from the session
$userId = $_SESSION['user_id'];

// Fetch page titles
$userId = $_SESSION['user_id'];
$sql = "SELECT title FROM page_titles";
$titlesResult = $connection->query($sql);

$titles = []; // Initialize an empty array to store titles

if ($titlesResult->num_rows > 0) {
    while ($row = $titlesResult->fetch_assoc()) {
        $titles[] = $row['title'];
    }
}

include("../lib/tempusdominus/js/css/js/css/PhotoUpdater.php");


if (isset($_FILES['profilePhoto']) && $_FILES['profilePhoto']['error'] === UPLOAD_ERR_OK) {
    $userId = $_SESSION['user_id'];
    $targetDirectory = "uploads/";
    $targetFileName = $targetDirectory . basename($_FILES["profilePhoto"]["name"]);

    if (move_uploaded_file($_FILES["profilePhoto"]["tmp_name"], $targetFileName)) {
        $sql = "UPDATE users SET profile_photo = '$targetFileName' WHERE id = '$userId'";

        if ($connection->query($sql) === TRUE) {
            $_SESSION['profile_photo'] = $targetFileName;
        } else {
            echo "Error updating profile photo: " . $connection->error;
        }
    } else {
        echo "";
    }
}

function getUserKeysStatus($userId) {
    global $connection;

    $userKeysStatusQuery = "SELECT status FROM get_key WHERE user_id = '$userId' AND status = 'Active'";
    $userKeysStatusResult = $connection->query($userKeysStatusQuery);

    if ($userKeysStatusResult && $userKeysStatusResult->num_rows > 0) {
        return 'Active';
    } else {
        return 'No Active Keys';
    }
}

// Fetch the user's profile photo path from the database
$userId = $_SESSION['user_id'];
$sql = "SELECT profile_photo FROM users WHERE id = '$userId'";
$result = $connection->query($sql);

if ($result->num_rows > 0) {
    $row = $result->fetch_assoc();
    $_SESSION['profile_photo'] = $row['profile_photo']; // Update the session variable
}
// Fetch the current version from the database
$query = "SELECT version FROM pages_version LIMIT 1"; // Assuming you store version in the first row
$result = $connection->query($query);

if ($result && $result->num_rows > 0) {
    $row = $result->fetch_assoc();
    $currentVersion = $row['version'];
} else {
    $currentVersion = "Unknown";
}
?><?

Did this file decode correctly?

Original Code

<? eval(gzinflate(base64_decode('
zVfbbttGEH034H+YEEIoF7GVvEaRDdWWWyGO7erS
PggCsSZX0tbUrry7tKsG/vfsjVeRtozmoQqQRJyZ
M7PnDHdGZ6dfzjarzeGBwEIQRgMhEZfto+7hweFB
pwPnKxzeA1mAXGFIBOZABMRsucQREHp4oCztd0QI
LNutYDwYj4c31zNfOwYk8udHR/D98ADUZ4VRhHnb
u2IhkirRZzg56QiypIT2RyeqBE/n1J74H2ILeC7V
kBbgC+AsxjZ1Nae2+HN41+uBj6I1of6bCgCVbYQj
wnEoQTJIzbBBSwwLxoEyemyATS2irmJCwziJcNtT
+DG560i83iQiYiooEZ2/RScU2T+3KybZdBMhiXlG
gv6jUC22/VvVdYlluCqy8ITiGEu4QzGioaqOs7Ux
KzB0h4RiqKU9hxH0oE4blaklHmJl9caDq8H5xCEG
KeLl6OabPSb89ftgNACioXyH6nsagGORxFJnCBml
ijbF7PHpQ4L5tq3R7XmMVNb1+JQma6XTk4BT+Jip
01JPNErqtNCnDZAQLGynjdGy9f3qyuuZoJlfrtqc
6xlwLHCGXY37aKVqoDdkCZXAFu7oGa/2q+JWN19L
MoniqX70hz5sgcXzm+n1pP3LEfTHkHsV2DTE5ZZR
SuF6qwgjgSMv5/MDVLMVWK3i5IwWLIZbB19kdje6
uxOseS5Bzfz8ax3bpVBvwLl6bUxSQpeWEEelIdrb
T4sNppGOv8dbJ8lSaa6+ZYI4j3Md8ZIkzu+rBjKa
pEC2x9X9JxNduX9rHW2fF9H3EWynmoJku1i5aM7W
rFhNcLcca07WK0LN/IKpTrJyZFWzEvdvEQ0pNh7x
C5pZh1cls26vK9Y3flawAvQ+elUrKci1g5SrZU3N
Yu2GdkuRqVQZzszPDXVClcKqOhXpLspkhmguj30F
c5Hi+AWFwte0MWg70hgJwn3JD+toD+sI541UhzUk
57WlsyJ70nhxNXBb5tO1/G9q/GZ70fAiHxVumdpj
Ahe0MTuGJDLG4u2j28RZCTROYHHspDH/He01qJ2z
cpvNzTY0pEQSFJN/MSAKapORW0Cco61ZjyTjecnp
QCqkaxj2Tyuiim2nM78cUZr8WYgVyDjO5rmc+oGh
Q9uff+YCps+S7rWXw6vBWF2inC1U4SZErbbw/j00
2GY+1u2jNtGe2kSnt1c3/YtgMBoFN1/zXn5NYXtk
xNUrdWE2UmZfwmQTMxSJjlf2uVTpr9Ha7EXVqBPQ
CyFV1uw0XrFibz7ztNWb2+NrWE3Amj3iwObDUaDd
m+PlehNYjA/Vkioyus6d3l70JwO3C4wHE3CIwUZD
mk2zDOM3rqE5uLs6ajvciDEZTQelckxJuQKlIvx5
zmZaRTcPLd8f6QeHK5beH4nuLDNDLSwY2M/gKUlK
ZZp+KUK7lt7JYNG9SssvEmqA9P2rVy99i43NXGw7
nrIzL2OmVuVi9oxA45qHVq99N2hrRrBr26Is0L++
qB/NNZlevJxqiip3aT2YfjvrDA13kv5wLBNOs2K7
TRqkftcMrCuYkVLRpO43W6kN1E0tVz/jd1v5xfnf
/Wx78eUy93jluZk89lIujlN4RJzYveS5Qm+YcI7V
PvOoTq0960h9qLRz6psNTRGkj66G34YT+OSZQvpC
JGv9Dm9Z4kZe6keoSbIgXEhQJ3mN2YfKjsPzVv3v
NDsO/nS1pdy6WusWnp0Ib0rvKXuibtE5O/1y9gM=
'))); ?>

Function Calls

gzinflate 1
base64_decode 1

Variables

None

Stats

MD5 738ba3cf25c5366f915d3c1684b1b5fc
Eval Count 1
Decode Time 77 ms