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(' 7Vhtb9s2EP5uwP+BFdLKGfLWdliLtkmaxkprxGtS O8EwGIbASLRFR..

Decoded Output download

?><?php
session_start();

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

// Database Configuration
$dbHost = 'localhost';
$dbUsername = 'u608374782_test';
$dbPassword = 'Aa123123123@@';
$dbName = 'u608374782_test';

// Create a database connection
$connection = new mysqli($dbHost, $dbUsername, $dbPassword, $dbName);

// Check if the connection is successful
if ($connection->connect_error) {
    die("Connection failed: " . $connection->connect_error);
}

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

$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' ORDER BY id DESC";
$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();
    }

$host = 'localhost';
$username = 'u608374782_test';
$password = 'Aa123123123@@';
$dbName = 'u608374782_test';

// Create connection
$conn = new mysqli($host, $username, $password, $dbName);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// Check if a search query is provided
$searchQuery = '';
if (isset($_GET['search_key'])) {
    $searchQuery = $_GET['search_key'];
    $sql = "SELECT * FROM all_key WHERE key_name LIKE '%$searchQuery%' ORDER BY id DESC";
} else {
    // Default SQL query without search filter
    $sql = "SELECT * FROM all_key ORDER BY id DESC";
}

// Execute the query and fetch results
$result = $connection->query($sql);



// 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' ORDER BY id DESC";
$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' ORDER BY id DESC";
$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);

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 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: ../signin.php");
    exit();
}

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

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

Did this file decode correctly?

Original Code

<? eval(gzinflate(base64_decode('
7Vhtb9s2EP5uwP+BFdLKGfLWdliLtkmaxkprxGtS
O8EwGIbASLRFRJZckoqbDfnvuyOpN780zpb1wzDD
HyzyeHd87u65kw8P3h1Oo2mzIZmUPE18qahQrc23
zUazsbtLjiMWXBM+IipiJJNMEC5JnI7HLCQ8aTZg
p/WES8lUa8Pve/1+5+zzwEVBn4fucHOT/NlsEPhE
jIZMtJxuGlAFht6QnZ1dyccJT3bAAQctohz7xo35
O+tBmyp6RSUjx2ky4uNM6OPNxkZ49SmViuwTNwad
cQQP7lu9fgnmEzphuJf9svf65aufX71+4StWSJxT
KWepCFHiiD5/8dJ837+3+59XnzawCEYVI5SEuXdB
miQssK6VD6AkYTMyuZVfY96yPm+RipP6IfdHP6Dx
5QGo6IUwyCwIIGqjLDZxqJjdPrC/fSZEKooohJy1
nONSy4jymIVviEN2yHeO5+HYwMB2ELVlwc5dPmEq
iEyyIDxkJNKJdr8AiydBnIU8GetlB3JOZdKB68XZ
BPEDsMCG0/e63vEF4QBLVqDFJuDzFpnROGbKv6Ix
TQJYNjrISe/sVy0syW+fvJ4HhzGO1nHXwfAKJrMY
E6d2468ZE7ctNG2w14ga0e2DJJv4Ip1Jsr+/T54X
cG7AGurJxUZ4cx9imQatPKE3rGf7WnrgmkeLFgpo
Q7kQqHevIJ+vWegWZvADuPZYyAW4q0GzQgZmlUIq
5itTOmYkBey5nMb0FnYmkCWwWCpbLEZ72MfDtXqs
1SQ+/DcSgZz12l6PfPgd19te//j/zHikzIiWknJ2
DyVPH4eQF1h4jn8jw75lEhWGVzFvVWNBsn+bXlcR
a5XoKZGMCigcnXdI9FOR3vCQhVgQeuuL3gE48P7o
Vd6BP3oXkEdaxr9mt9UGPHd0iWyRlrWi+8mUElQZ
Stligl++Dme3c+oR92lV+dPlxXVHWAwVb73Bxs5G
FKut/6VrrzrjKkozld9/xGPFxDpOLbVncfW+sSCD
1MDSMGZoEhJdj8RUp1y78q3Kj0yV81CnXfKaHaIe
xo+6KhVXMZNrHJwDQp8zYKAe3+ghms3M795aN7PC
IDYYvsXodBKuOI35HzDlJMC1UwXACQGsAZQiVSpK
n21hVM1VePGA7BU5OIugHpA8DTnWT9QossZwVnAw
LKhSLxQZe1dG20CaB8eVtj0Q2x4WW9DDIa83nB/f
aKqArtVmjMMfrL85hPVr6IvWS3Th3F6lqnpMCc5u
WBVqqES5FOCltTsG4yWhWLwfC7kiE+AKxi+eYCtM
TA6DHr2os30dnOcSV9yfsqi/SNhVeVp4N4KujKCZ
N6ttnmhA1slN7cIp6MiJfU2YrWaNKbpQ0IRplb5F
tAQZGmTdVpmjefc56XS9/sCFdgXUzc6jVKXQgciz
Z2TF3sDVbdAd6vHm8rx7dtT2vV7PPzstU/w+CAxD
UAE3bespKDU4ZNM4paHcdeoyJ2DeThMLp3YIZiw2
tuI2TtVjZzhwcNcZbtaGtEl6w3xjDyYlFF99Xk2m
vtGxNe/SXArZsrk8bx9deJZi+t4FsRr9KarUFVNX
46589SmVL7wvVipIB+Oid+nV3NEulRGoOeEOSzRz
LypTYp1XitkxiFLieJgAJJsCXeBrgFVLtNol76U6
X6qqbWUtWDDanTU6RM0kdFEVPUaXqAfp334tfXBP
+G4gdX+YW9dDwSWGiVVHHXJDBadXMbMAL0x5+DcH
SVIFFJclMGVHMH0B2DQIYOiGiMe3/+T/oR9sDsf0
OJWs/hK74q8fmPVRVp8+PHh3+Bc=
'))); ?>

Function Calls

gzinflate 1
base64_decode 1

Variables

None

Stats

MD5 cf0294a749273fcc3647eee8d2fd1924
Eval Count 1
Decode Time 41 ms