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(' zVdbU9tGFH5nhv+w0XgiuxNw8prGMBSL4Alg6gt9 8DCaRVrbW6SVs..
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: ../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 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: ../OwnerEN/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: ../OwnerEN/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: ../OwnerEN/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('
zVdbU9tGFH5nhv+w0XgiuxNw8prGMBSL4Alg6gt9
8DCaRVrbW6SVsyvZpR3+e8/ZlWStZWNo8lB4IJHO
9Tvfuej05MvpYr44PGi3yfmcBY+ET0k6Z+SRPZFe
l3BFFjJZ8pCFhCpCyfeMySeyoJLGLGXy8ADkm1wp
ljYb/ldvNHF7Xfe+1SL/HB4Q+AG7X1laNTmVSaz/
XzOF8g2Q6oWkQyrWfj08wF/FlOKJ8FVKZdps6aeb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1lAuD2MTs1p7gKQdE
/mYaXz2sqJT0Sd9NKU7EIuT8Cqi627HWVnO8bJrF
SWBrWPvNnu1GcLK+BvQDDUdOyWcL0co5tYLpBOfz
A42oCNjPOKWMRb+w+L+7pUx8v+XhFYjZUeu87KFT
0/tYnLzVD5SL3pU3LK+xW3OMtcj792THu4mr+wsv
OZjj49ur/lnX9wYDv/9tnda+ChgSUAlbp6vnQCJx
3TjZIkpoqNqOLXMB7m/gm0hzbEPrmGDVBbwts3Gq
ETv3EwffOvf2vRYnS+Ybfyz0UXy3fhovfGPjw2ZI
G8RW1lI1LMKVap/rSCfbjLuTa/Ytsotvu5fqy6e4
HcXee4MF86S2hKwPnFesoeddp66x7rw0BIJMSriV
yBKAxcttW/ubr+h1fxey5UxVfvHoqnfdG5FPjp6Q
Z0plMSaEp6KZiIVcfk9NuVQpfMuu9o0A/ac2BHRX
/fg8yDG4y2MrBkIe67ZJUNNwxuJRJCvhFCMB9+GX
038B
'))); ?>
Function Calls
gzinflate | 1 |
base64_decode | 1 |
Stats
MD5 | f14f95a1ae5dd594a5b32fd36a7adc60 |
Eval Count | 1 |
Decode Time | 74 ms |