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(' zVltT9tIEP6OxH/YWlGTnNJAT/1UGhAHpnClJE3C 9SSELGNvki1+S..

Decoded Output download

?><?php
session_start();

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

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

$userId = $_SESSION['user_id'];

// Fetch user data from the database including the "status" column
$sql = "SELECT id, username, email, wallet_balance, status FROM users WHERE id = '$userId'";
$result = $connection->query($sql);

if ($result->num_rows === 1) {
    $row = $result->fetch_assoc();
    $status = $row['status'];

    if ($status === 'blocked') {
        // Redirect the blocked user to a blocked page or display a message
        header("Location: blocked_page.php");
        exit();
    }

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

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

// Retrieve the user's keys from the database
$sql = "SELECT * FROM get_key WHERE user_id = '$userId'";
$result = $connection->query($sql);

// Fetch all keys into an array
$keys = [];
if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        $keys[] = $row;
    }
}

// Fetch all keys for the logged-in user
$userId = $_SESSION['user_id'];
$fetchKeysQuery = "SELECT * FROM get_key WHERE user_id = $userId";
$keysResult = mysqli_query($connection, $fetchKeysQuery);

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





// Check if the password update form is submitted
if (isset($_POST['update_password'])) {
    $currentPassword = $connection->real_escape_string($_POST['currentPassword']);
    $newPassword = $connection->real_escape_string($_POST['newPassword']);
    $confirmNewPassword = $connection->real_escape_string($_POST['confirmNewPassword']);
    $userId = $_SESSION['user_id'];

    // Perform validation and password update logic
    if ($newPassword !== $confirmNewPassword) {
        $passwordErrorMessage = "New passwords do not match.";
    } else {
        // Check if the current password is correct
        $checkCurrentPasswordQuery = "SELECT password FROM users WHERE id = '$userId'";
        $result = $connection->query($checkCurrentPasswordQuery);
        if ($result->num_rows === 1) {
            $row = $result->fetch_assoc();
            $hashedCurrentPassword = $row['password'];

            if (password_verify($currentPassword, $hashedCurrentPassword)) {
                // Hash the new password
                $hashedNewPassword = password_hash($newPassword, PASSWORD_DEFAULT);

                // Update the password in the database
                $updatePasswordQuery = "UPDATE users SET password = '$hashedNewPassword' WHERE id = '$userId'";
                if ($connection->query($updatePasswordQuery) === TRUE) {
                    $passwordSuccessMessage = "Password updated successfully.";
                } else {
                    $passwordErrorMessage = "Failed to update password. Error: " . $connection->error;
                }
            } else {
                $passwordErrorMessage = "Incorrect current password.";
            }
        } else {
            $passwordErrorMessage = "User not found.";
        }
    }
}

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

if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_FILES["profilePhoto"])) {
    $uploadDirectory = "../img/"; // Change this to your desired directory
    $uploadFile = $uploadDirectory . basename($_FILES["profilePhoto"]["name"]);
    $uploadOk = 1;
    $imageFileType = strtolower(pathinfo($uploadFile, PATHINFO_EXTENSION));

    // Check if the uploaded file is an image
    $check = getimagesize($_FILES["profilePhoto"]["tmp_name"]);
    if ($check !== false) {
        $uploadOk = 1;
    } else {
        $uploadOk = 0;
    }

    // Check if file already exists
    if (file_exists($uploadFile)) {
        $uploadOk = 0;
    }

    // Check file size
    if ($_FILES["profilePhoto"]["size"] > 4000000) {
        $uploadOk = 0;
    }

    // Allow certain image file formats
    if ($imageFileType != "jpg" && $imageFileType != "jpeg" && $imageFileType != "png") {
        $uploadOk = 0;
    }

    if ($uploadOk == 1) {
        if (move_uploaded_file($_FILES["profilePhoto"]["tmp_name"], $uploadFile)) {
            // Update the user's profile photo path in the database
            $userId = $_SESSION['user_id'];
            $profilePhotoPath = $uploadFile; // Update this with the correct path
            $updateQuery = "UPDATE users SET profile_photo = '$profilePhotoPath' WHERE id = $userId";

            if ($connection->query($updateQuery) === TRUE) {
                $_SESSION['profile_photo'] = $profilePhotoPath;
                $successsMessage = "Profile photo updated successfully.";
            } else {
                $errorrMessage = "Failed to update profile photo. Error: " . $connection->error;
            }
        } else {
            $errorrMessage = "Error uploading profile photo.";
        }
    } else {
        $errorrMessage = " (JPEG  PNG)        4 . ";
    }
}

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


} else {
    // User not found, handle accordingly
    header("Location: ../signinAR.php");
    exit();
}

// Close the database connection
$connection->close();
?><?

Did this file decode correctly?

Original Code

<? eval(gzinflate(base64_decode('
zVltT9tIEP6OxH/YWlGTnNJAT/1UGhAHpnClJE3C
9SSELGNvki1+Sb02XK7iv9/M7tretWMI9E668AGy
np2ZfeaZlzUH+x8Olovl9hannLM4cnjqJmmnu7e9
tb21s0OOFtS7JWxG0gUlGacJYZwE8XxOfcKi7S14
0nnFOK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