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(' zVZNb9s4EL0b8H+YGkYlHxJ3r93aQTdRNwKSuLWV 7MEIBEaiLW5l0..

Decoded Output download

?><?php
session_start();

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

// Check the user's role
if ($_SESSION['user_role'] !== 'admin') {
    header("Location: ../signin.php"); // Redirect to signin 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;
}


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

// Handle form submission for updating titles
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $newTitles = $_POST['titles'];

    // Delete existing titles from the table
    $deleteSql = "DELETE FROM page_titles";
    $connection->query($deleteSql);

    // Insert new titles into the table
    foreach ($newTitles as $newTitle) {
        $insertSql = "INSERT INTO page_titles (title) VALUES ('$newTitle')";
        $connection->query($insertSql);
    }

    // Redirect or show success message
}

// Handle form submission for adding new title
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['newTitle'])) {
    $newTitle = $_POST['newTitle'];

    // Insert the new title into the table
    $insertSql = "INSERT INTO page_titles (title) VALUES ('$newTitle')";
    $connection->query($insertSql);

    // Redirect or show success message
}


// 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";
}
    // Close the database connection
    $connection->close();
?>
<?

Did this file decode correctly?

Original Code

<? eval(gzinflate(base64_decode('
zVZNb9s4EL0b8H+YGkYlHxJ3r93aQTdRNwKSuLWV
7MEIBEaiLW5l0iWperOL/PcOSYmSExdNgBzWBmxD
HM68eW8+fDL9cLIttv2eokoxwVOlidTh6Pd+r98b
j+G0oNlXYCvQBYVKUQlMQSnWa5oD4/0enoRvmFJU
h8N0ES0W8exqGRjDlOXB7WgE//V7gK+CkpzKcHAh
MqIx0Hs4Ph4rtuaMHyOAgYlo7Og/zIV/2EPQhA8U
SFFSF/hxRHMS3MKbyQQCkm8YD14QHjDWnOZM0kyD
FuAOYUvWFFZCAhf8yDq1ONQhtIxnZZXTcIC+S3Y3
1nSzrVQu8FKlxn+rcab81+dCaHG9zYmm0hNg3uBe
iOYT1VnRzXxHypJquCMl4RmikmJjj9EJuSMKWRka
yziHCRxSAyMM1bcSTweL6CI6TWqPaePx03x26dKD
v86jeQTMuApqr8HAOJBUVaU2ETLBOZKFbB5Nv1VU
3ofGu8vDyuNMj6a82qA2OwVTeOcVGeIT46UxWpls
U6KUyMKmGIYO3x81vIm9tAz2Udu8HoCWinrfj++9
ayRy5+4TKf4T6fSVHZ+1lNbt8AxGbZE6qWytaKZL
ql4uhb3nFDB+UufHUu5+zp9FfG2MZstbW9MxZ5qR
kv1LgXDAitT3QKQk97bItZAt5Fq2brifiLcrGIIN
Gw33b+wp6a9YXZzh8tZLaR9YOsz5Q9v254Tnpe28
DajqbsOsHrYTK9M1jK897mYWzG+i+TKYR1+uo0WS
XkbJ+ewM58HEzIPPs0XSjoMhp7ukIWqYmsMai6pF
rQvkjGIdUdPnqhOyrRNsPDONrM/c2i6cqmeoahId
1NMaH9DQ3x91EcQca0YDAm6CM47KPQqOvFCCJRh2
MiOqzXNfBmZ91kjjK2QugfgqmXWRQqjdxZuPF8gn
hIF3FoyaNH6Wig8wapX1Gfkpi1qqAitIVVmG/QYb
/EAAzyoCkudGD0/LC6oA3r6FZmU55X1inYXls+1U
SGt3QCGjiIdzUKTX4/2XnL+U7M4U6yycrRQr0+hb
s6wQpC5eY+nUXlPn9X+3c9oc9oAG7dB69NyOWbfK
u7sDvhPJnPgPTwjOKikp1/Ad87YlfYBWm1+Ht8bW
zxSVNo8u4ss4gd8GFspHpaqNaY57UdUTvrHDfy8m
yIpJpfGP1O5X3NqvJ+yaBnoFomsObmpsDbs11kNr
/cmNwTX/ysWOD9x+r2v+tBSK7rEJbW4HGigz9hbX
ybTf+3DyAw==
'))); ?>

Function Calls

gzinflate 1
base64_decode 1

Variables

None

Stats

MD5 0983e0e8403794ddc35987ea24e289d2
Eval Count 1
Decode Time 58 ms