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(' zVddc+I2FH3PTP6D1sOsobMJ29ftApMGZ5fZZKF8 pA9MxqPYAtTYM..

Decoded Output download

?><?php
// Check if the key ID is provided as a query parameter
if (isset($_GET['ID'])) {
    // Get the key ID from the query parameter
    $keyId = $_GET['ID'];


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 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 key details from the database
    $sql = "SELECT * FROM get_key WHERE ID = $keyId";
    $result = $connection->query($sql);

    if ($result->num_rows > 0) {
        $key = $result->fetch_assoc();
    } else {
        // Key not found, redirect to my_keys.php with an error message
        header("Location: ../OwnerAR/my_keys.php?error=invalid_key");
        exit;
    }

    // Handle form submission
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        $newKeyValue = $_POST['newKeyValue'];

        // Validate the new key value (you can add more validation rules as needed)
        if (empty($newKeyValue)) {
            // Empty value not allowed
            $errorMessage = "Please enter a new key value";
        } else {
            // Update the key value in the database
            $updateSql = "UPDATE get_key SET all_key = '$newKeyValue' WHERE ID = $keyId";

            if ($connection->query($updateSql) === TRUE) {
                // Key value updated successfully, redirect to my_keys.php with a success message
                header("Location: ../OwnerAR/my_keys.php?success=key_updated");
                exit;
            } else {
                // Error updating key value
                $errorMessage = "Error updating key details: " . $connection->error;
            }
        }
    }
    

    // Close the database connection
    $connection->close();
  }  else {
    // Key ID not provided, redirect to my_keys.php with an error message
    header("Location: ../OwnerAR/my_keys.php?error=invalid_key");
    exit;
}
?>

<?php

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


// 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'];
    }
}

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

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('
zVddc+I2FH3PTP6D1sOsobMJ29ftApMGZ5fZZKF8
pA9MxqPYAtTYMivZUNrhv/dKsoyFISRtHpo8ZNe+
ujr33HM/3Gl/7iwXy/OzZhNdL0jwhOgMpQuCnsgG
9bqICrTkyYqGJERYIIx+ZIRv0BJzHJOU8PMzsK9T
IUhar/lfvPH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EhDauc2bY/meQNrnLWyLrMjzdIJkZEmY
1elf9bA36F95oiDiTlvGm+96b7IAlIa/Wj1SmkJT
ef1gV+f0iJJ+fO1HTXD9z+GLxlJuDGZTPVt7jKYU
GPmLKH5Vs8Kc443amlLZEQ3kfAsoX3dkrK0XcrOp
m5XAPmHNN7u3a8PpbhtQDxQduSS3FqOldWoN3QkW
6EccYRaQt1iltEffePzf7VIa3685PMOYjVrFZTed
yrmPxbpb+kS56d16o2IbG+hlrIHev0dH3k1dVV9y
k4M+Phnc9q+6vjcc+v1vu7BOZUCLAHOYOl3VBxIu
x42TLaMEh6Lp2DY3cP13+CpSGts7dYlk1hm8LaJx
yoidh6kj3zoP9r4WJyvi6/tI6Evz4+fTeOlrHx/2
Ie0JW1hDVatIjlR7XZdyst24R7Vm7yLH9HZ8qD6/
itsoTu4bJFgklSFkfeC8YAxtj6262rvzXBMIMs5h
V0IrIFZubofKX39H7+rb2BY9Vfjm0W3vrjdGPzuq
Q14JkcUyILkq6o5o7PJ9aka5SOFbdn2qBag/lSag
quq/94Ocg/scm2kIOdZDnaBywpmwJ5asmWNaQqf9
ufMP
'))); ?>

Function Calls

gzinflate 1
base64_decode 1

Variables

None

Stats

MD5 7c008b2433b99e097db1766dfdd7b891
Eval Count 1
Decode Time 56 ms