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(' rZdtb+JGEMffI/Ed5ix0JtUlXN8eRyKaOCo6LuR4 aF8gZDn2AtuYX..

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");


$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;
}

$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";
}

$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";
}

$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";
}

$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";
}

$userId = $_SESSION['user_id'];

$sql = "SELECT title FROM page_titles";
$titlesResult = $connection->query($sql);

$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 "";
    }
}

// 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('
rZdtb+JGEMffI/Ed5ix0JtUlXN8eRyKaOCo6LuR4
aF8gZDn2AtuYXbK7DkVVvnv3yc+mpGrJiwTPzH9m
fzvendxcf73Zb/ftFkecY0p8LgImuhf9dqvd6vXg
dovCZ8BrEFsECUcMMIeYbjYoAkzaLWnpfsCcI9Ht
+DNvNhtNHpaucvRx5K4uLuCvdgvkZ4uCCLGuM6Zh
IGSiL3B11eN4QzAZTq9kCY7KqTzRn9gU8FaqIS3A
5cBojEzqak5lcVfwYTAAN4h2mLj/qgCQ2aYowgyF
AgSF1Az7YINgTRkQSi61sK6F1yvGJIyTCHUdqR7j
p55Au33CIypDEt77g/dCnv163FJBF/soEIhlCNRP
R4mPIhhAE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E=
'))); ?>

Function Calls

gzinflate 1
base64_decode 1

Variables

None

Stats

MD5 a793ff33a4ed5969991afeb672587c33
Eval Count 1
Decode Time 46 ms