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 goto Ck0D1; nFLTs: $conn->close(); goto QBIlm; gAYwA: switch ($report_type) { case..

Decoded Output download

<?php 
 goto Ck0D1; nFLTs: $conn->close(); goto QBIlm; gAYwA: switch ($report_type) { case "daily": $sql = "SELECT id, bill_number, order_type, payment_method, bill_size, total_payable, total_tax, date_time \xa                FROM selling_report 
                WHERE user_id = ? AND DATE(date_time) = ? \xa                ORDER BY bill_number DESC"; break; case "weekly": $sql = "SELECT id, bill_number, order_type, payment_method, bill_size, total_payable, total_tax, date_time 
                FROM selling_report \xa                WHERE user_id = ? AND YEARWEEK(date_time, 1) = YEARWEEK(?, 1) 
                ORDER BY bill_number DESC"; break; case "monthly": $sql = "SELECT id, bill_number, order_type, payment_method, bill_size, total_payable, total_tax, date_time 
                FROM selling_report \xa                WHERE user_id = ? AND MONTH(date_time) = MONTH(?) AND YEAR(date_time) = YEAR(?) 
                ORDER BY bill_number DESC"; break; default: echo "Invalid report type"; die; } goto RREvb; TuV7v: $stmt->close(); goto nFLTs; XAbpz: if (empty($report_type) || empty($date_filter) || empty($user_id)) { echo "Invalid parameters"; die; } goto tJLVa; W8ggS: require "db_connection.php"; goto or6ZY; BJUVi: if ($result->num_rows > 0) { echo "<table>\xa            <thead>
                <tr>
                    <th>Bill Number</th>
                    <th>Order Type</th>\xa                    <th>Payment Method</th>\xa                    <th>Bill Size</th>
                    <th>Total Amount</th>\xa                    <th>Total Tax</th>
                    <th>Total Payable</th>\xa                    <th>Date and Time</th>\xa                    <th>Actions</th>\xa                </tr>\xa            </thead>\xa            <tbody>"; while ($row = $result->fetch_assoc()) { $total_amount = $row["total_payable"] - $row["total_tax"]; echo "<tr>
                <td>" . htmlspecialchars($row["bill_number"]) . "</td>
                <td>" . htmlspecialchars($row["order_type"]) . "</td>\xa                <td>" . htmlspecialchars($row["payment_method"]) . "</td>
                <td>" . htmlspecialchars($row["bill_size"]) . "</td>\xa                <td>" . htmlspecialchars($total_amount) . "</td>\xa                <td>" . htmlspecialchars($row["total_tax"]) . "</td>
                <td>" . htmlspecialchars($row["total_payable"]) . "</td>
                <td>" . htmlspecialchars($row["date_time"]) . "</td>
                <td>
                    <button class='delete-btn' onclick='deleteRecord(" . htmlspecialchars($row["id"]) . ")'>Delete</button>
                    <a class='reprint-btn' href='reprint_bill.php?bill_number=" . htmlspecialchars($row["bill_number"]) . "'>Reprint</a>
                </td>
              </tr>"; } echo "</tbody></table>"; } else { echo "<p class='no-records'>No records found for the selected date.</p>"; } goto TuV7v; E6rfE: if ($stmt === false) { echo "Failed to prepare the statement"; die; } goto dvQ6L; tJLVa: $sql = ''; goto gAYwA; fwbFc: $date_filter = $_GET["date_filter"] ?? ''; goto yxYYk; Ck0D1: session_start(); goto q9vPP; or6ZY: $report_type = $_GET["report_type"] ?? ''; goto fwbFc; gNUNq: $result = $stmt->get_result(); goto BJUVi; RREvb: $stmt = $conn->prepare($sql); goto E6rfE; q9vPP: if (!isset($_SESSION["user_loggedin"]) || $_SESSION["user_loggedin"] !== true) { header("Location: /user-login.php"); die; } goto W8ggS; yxYYk: $user_id = $_SESSION["user_id"] ?? ''; goto XAbpz; cbnOB: $stmt->execute(); goto gNUNq; dvQ6L: if ($report_type == "monthly") { $stmt->bind_param("iss", $user_id, $date_filter, $date_filter); } else { $stmt->bind_param("is", $user_id, $date_filter); } goto cbnOB; QBIlm: ?> 
<script>function deleteRecord(e){confirm("Are you sure you want to delete this record?")&&console.log("Record with ID "+e+" will be deleted")}</script>

Did this file decode correctly?

Original Code

<?php
 goto Ck0D1; nFLTs: $conn->close(); goto QBIlm; gAYwA: switch ($report_type) { case "\x64\x61\x69\154\x79": $sql = "\x53\105\114\x45\x43\124\40\151\144\x2c\x20\x62\151\154\154\x5f\x6e\x75\x6d\x62\x65\x72\x2c\x20\157\x72\144\145\x72\137\x74\171\x70\145\x2c\x20\160\141\171\155\x65\156\x74\x5f\x6d\145\x74\x68\157\144\x2c\40\142\x69\154\154\x5f\163\151\172\145\x2c\40\x74\x6f\x74\141\x6c\x5f\160\x61\x79\x61\142\x6c\x65\54\40\x74\157\x74\x61\154\137\164\141\170\x2c\x20\x64\141\164\x65\x5f\164\x69\155\145\40\xa\x20\40\x20\x20\40\40\40\x20\40\x20\x20\40\x20\40\x20\x20\106\122\x4f\x4d\x20\163\x65\154\x6c\x69\156\x67\x5f\162\145\x70\x6f\162\x74\x20\12\40\40\x20\40\x20\40\40\40\40\40\40\40\x20\x20\40\x20\127\110\105\122\105\40\x75\x73\x65\162\x5f\151\144\x20\x3d\40\77\40\x41\116\104\40\x44\x41\x54\105\x28\x64\x61\x74\x65\137\164\x69\155\145\x29\40\x3d\x20\77\40\xa\x20\40\40\x20\40\40\40\x20\x20\40\x20\40\x20\x20\x20\40\117\x52\104\105\x52\x20\x42\131\40\x62\151\x6c\x6c\137\156\x75\x6d\x62\145\x72\40\104\105\x53\103"; break; case "\x77\x65\145\153\154\171": $sql = "\x53\105\114\105\x43\124\x20\151\x64\54\40\x62\x69\x6c\x6c\137\x6e\165\x6d\x62\145\162\54\40\157\162\144\x65\162\x5f\x74\x79\160\145\x2c\x20\160\141\x79\155\x65\x6e\164\137\x6d\x65\164\x68\x6f\144\54\x20\x62\151\x6c\x6c\137\163\x69\172\145\54\40\164\157\x74\x61\154\137\160\141\x79\x61\142\x6c\x65\x2c\x20\164\x6f\x74\x61\154\137\x74\141\170\54\x20\x64\x61\x74\x65\x5f\x74\151\155\145\40\12\40\40\x20\x20\x20\x20\x20\x20\x20\40\40\40\40\40\40\x20\x46\122\x4f\115\x20\163\x65\x6c\x6c\x69\x6e\x67\x5f\x72\145\x70\157\x72\164\40\xa\40\40\x20\40\40\40\x20\40\40\40\x20\40\40\40\x20\40\127\110\105\x52\x45\x20\165\x73\x65\x72\137\x69\144\40\75\x20\77\x20\x41\x4e\x44\40\131\x45\x41\x52\127\105\x45\x4b\x28\144\x61\x74\145\137\164\151\155\145\x2c\40\x31\x29\x20\x3d\x20\131\105\x41\x52\127\x45\x45\113\50\x3f\x2c\x20\x31\51\x20\12\40\x20\x20\x20\40\x20\x20\x20\40\40\40\x20\40\x20\x20\x20\x4f\x52\104\105\x52\40\x42\x59\x20\142\x69\x6c\x6c\x5f\x6e\x75\155\x62\x65\x72\40\104\x45\x53\x43"; break; case "\155\x6f\156\x74\x68\154\171": $sql = "\x53\105\114\105\103\124\40\x69\x64\54\x20\x62\151\x6c\154\x5f\x6e\165\x6d\142\x65\162\54\x20\x6f\162\x64\145\162\137\x74\171\x70\145\x2c\40\x70\141\171\155\145\156\x74\137\x6d\x65\164\x68\157\144\x2c\x20\142\x69\x6c\154\x5f\163\151\x7a\145\54\x20\164\157\164\141\x6c\137\x70\141\x79\141\142\x6c\145\54\40\164\x6f\x74\x61\154\137\164\141\x78\x2c\40\x64\141\164\145\x5f\164\151\155\145\x20\12\x20\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\106\x52\117\115\40\x73\145\154\154\151\156\x67\x5f\162\x65\x70\157\x72\164\x20\xa\40\x20\40\40\x20\40\x20\x20\40\x20\40\40\x20\x20\x20\40\x57\110\x45\122\105\40\x75\x73\x65\x72\137\151\x64\x20\x3d\40\77\40\x41\x4e\104\x20\115\117\x4e\124\x48\50\144\x61\164\x65\x5f\164\151\155\145\51\40\75\x20\115\x4f\x4e\x54\x48\x28\77\x29\40\x41\116\104\x20\x59\105\x41\x52\x28\x64\141\x74\x65\x5f\164\x69\x6d\145\51\x20\x3d\40\x59\105\101\x52\50\x3f\x29\40\12\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\40\40\40\x4f\122\x44\x45\122\x20\x42\x59\x20\142\x69\154\x6c\137\156\165\155\142\145\x72\x20\x44\x45\123\103"; break; default: echo "\111\x6e\x76\141\x6c\151\x64\40\162\145\x70\x6f\162\x74\40\164\x79\x70\145"; die; } goto RREvb; TuV7v: $stmt->close(); goto nFLTs; XAbpz: if (empty($report_type) || empty($date_filter) || empty($user_id)) { echo "\x49\156\x76\x61\x6c\x69\144\x20\160\x61\162\x61\x6d\x65\164\145\x72\163"; die; } goto tJLVa; W8ggS: require "\x64\x62\137\143\157\156\x6e\145\143\164\x69\x6f\156\56\x70\x68\x70"; goto or6ZY; BJUVi: if ($result->num_rows > 0) { echo "\74\164\141\x62\x6c\x65\x3e\xa\x20\x20\40\x20\40\40\x20\40\x20\x20\40\x20\74\x74\150\x65\x61\x64\x3e\12\x20\40\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\40\40\x20\x3c\164\162\x3e\12\40\40\40\40\40\40\40\x20\x20\x20\x20\x20\40\x20\40\40\40\40\x20\x20\74\x74\x68\76\102\x69\x6c\154\x20\116\165\155\x62\x65\162\x3c\57\x74\150\x3e\12\40\40\x20\x20\40\40\x20\40\40\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x3c\164\x68\x3e\117\x72\x64\145\162\x20\124\x79\x70\145\x3c\x2f\164\150\76\xa\x20\x20\40\x20\40\40\40\40\40\40\x20\x20\40\x20\40\40\40\40\x20\x20\x3c\x74\x68\x3e\x50\x61\x79\155\145\156\164\x20\115\145\x74\150\157\144\x3c\x2f\164\x68\x3e\xa\40\x20\40\x20\40\40\40\40\40\x20\40\40\40\40\x20\x20\x20\40\40\40\74\164\150\x3e\x42\151\154\154\40\x53\x69\172\145\74\57\x74\150\76\12\40\x20\40\x20\x20\40\x20\40\40\40\x20\x20\40\40\x20\40\x20\x20\x20\40\x3c\164\150\x3e\124\157\x74\141\x6c\x20\x41\x6d\157\165\156\x74\x3c\x2f\x74\x68\x3e\xa\x20\x20\x20\40\40\x20\40\40\x20\40\x20\40\x20\x20\x20\40\x20\40\40\40\74\164\150\76\x54\157\164\141\154\40\124\141\x78\74\57\x74\x68\76\12\40\x20\40\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\74\x74\x68\x3e\x54\157\164\141\x6c\40\120\141\171\141\x62\x6c\x65\x3c\x2f\x74\150\76\xa\40\40\40\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\74\164\x68\76\104\x61\164\145\40\x61\x6e\144\x20\x54\151\155\145\x3c\x2f\x74\x68\76\xa\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\40\x20\x20\40\x20\x3c\164\x68\76\x41\143\164\151\x6f\x6e\163\74\x2f\164\x68\x3e\xa\40\40\x20\40\x20\x20\40\40\40\x20\40\40\40\40\x20\40\74\x2f\164\x72\x3e\xa\40\x20\40\x20\40\40\x20\40\x20\40\40\x20\x3c\57\x74\150\x65\x61\x64\x3e\xa\x20\40\40\40\40\x20\x20\40\x20\x20\40\x20\74\x74\142\157\144\171\76"; while ($row = $result->fetch_assoc()) { $total_amount = $row["\x74\x6f\164\141\154\x5f\160\141\171\x61\x62\154\145"] - $row["\164\157\164\141\x6c\x5f\164\141\170"]; echo "\x3c\x74\x72\x3e\12\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x3c\x74\144\76" . htmlspecialchars($row["\x62\x69\154\154\x5f\156\x75\155\x62\145\162"]) . "\x3c\x2f\x74\144\x3e\12\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\40\x20\x20\x20\40\x3c\164\x64\x3e" . htmlspecialchars($row["\x6f\x72\x64\145\x72\x5f\164\x79\160\145"]) . "\74\57\x74\144\76\xa\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\74\164\144\76" . htmlspecialchars($row["\x70\141\171\x6d\x65\x6e\164\137\x6d\145\x74\x68\157\144"]) . "\74\57\x74\144\x3e\12\x20\40\x20\x20\40\40\40\x20\40\x20\40\40\40\40\40\40\x3c\164\x64\76" . htmlspecialchars($row["\x62\x69\154\154\x5f\163\x69\x7a\x65"]) . "\x3c\57\164\144\76\xa\40\40\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\40\x20\40\74\164\144\x3e" . htmlspecialchars($total_amount) . "\74\x2f\x74\144\76\xa\x20\40\40\40\x20\40\40\40\40\x20\40\40\x20\40\x20\40\x3c\x74\x64\76" . htmlspecialchars($row["\164\x6f\x74\141\154\137\164\141\170"]) . "\x3c\x2f\164\x64\76\12\40\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\40\x20\x20\40\x3c\164\144\x3e" . htmlspecialchars($row["\164\157\164\x61\154\x5f\160\141\x79\x61\142\154\145"]) . "\74\x2f\x74\x64\x3e\12\40\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\40\x20\74\164\x64\x3e" . htmlspecialchars($row["\x64\141\x74\x65\137\x74\x69\x6d\x65"]) . "\74\x2f\x74\144\x3e\12\40\40\x20\40\40\x20\40\40\x20\40\40\x20\x20\x20\x20\40\x3c\x74\144\76\12\40\40\x20\40\40\40\40\40\40\x20\40\40\x20\x20\40\40\40\40\x20\40\x3c\x62\165\x74\x74\157\156\x20\143\154\x61\163\163\x3d\x27\x64\x65\x6c\x65\164\x65\55\142\x74\156\47\x20\x6f\x6e\x63\154\x69\143\153\75\47\144\x65\x6c\x65\164\145\122\145\x63\x6f\x72\144\x28" . htmlspecialchars($row["\151\x64"]) . "\x29\x27\x3e\104\145\154\x65\164\145\74\x2f\x62\x75\x74\164\157\156\x3e\12\40\x20\40\x20\x20\x20\40\x20\40\x20\40\x20\40\40\40\40\40\x20\40\40\74\141\40\143\154\x61\163\x73\x3d\47\x72\x65\x70\162\151\x6e\x74\x2d\x62\x74\156\47\x20\150\162\145\146\75\x27\162\x65\x70\x72\x69\x6e\x74\137\x62\151\x6c\154\x2e\x70\150\160\77\142\151\x6c\154\x5f\156\165\x6d\x62\145\x72\75" . htmlspecialchars($row["\142\151\154\154\137\x6e\165\x6d\x62\145\162"]) . "\x27\x3e\x52\145\x70\162\x69\156\x74\74\x2f\x61\76\12\x20\40\40\40\x20\40\x20\x20\x20\40\40\x20\40\x20\x20\x20\74\x2f\x74\x64\x3e\12\40\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\x3c\57\x74\162\x3e"; } echo "\x3c\57\164\x62\x6f\x64\x79\76\x3c\57\164\141\x62\154\x65\76"; } else { echo "\74\160\40\x63\x6c\x61\x73\163\x3d\x27\x6e\x6f\55\x72\145\x63\157\162\144\163\x27\76\116\x6f\x20\x72\x65\143\157\162\144\163\x20\146\x6f\165\x6e\x64\40\x66\x6f\x72\x20\164\150\x65\x20\163\145\x6c\145\143\164\x65\144\x20\x64\141\x74\145\56\x3c\x2f\x70\x3e"; } goto TuV7v; E6rfE: if ($stmt === false) { echo "\106\141\151\x6c\x65\x64\x20\x74\x6f\x20\x70\162\x65\x70\x61\162\145\x20\x74\150\x65\x20\x73\x74\x61\164\x65\x6d\145\156\x74"; die; } goto dvQ6L; tJLVa: $sql = ''; goto gAYwA; fwbFc: $date_filter = $_GET["\144\x61\x74\145\x5f\x66\x69\154\164\x65\162"] ?? ''; goto yxYYk; Ck0D1: session_start(); goto q9vPP; or6ZY: $report_type = $_GET["\x72\145\x70\x6f\x72\164\137\x74\x79\160\145"] ?? ''; goto fwbFc; gNUNq: $result = $stmt->get_result(); goto BJUVi; RREvb: $stmt = $conn->prepare($sql); goto E6rfE; q9vPP: if (!isset($_SESSION["\x75\163\145\162\137\154\157\147\147\145\144\151\156"]) || $_SESSION["\x75\163\145\162\x5f\154\x6f\147\x67\x65\x64\151\156"] !== true) { header("\114\x6f\143\x61\x74\x69\157\x6e\x3a\x20\57\x75\163\145\162\x2d\x6c\157\x67\151\156\56\x70\150\160"); die; } goto W8ggS; yxYYk: $user_id = $_SESSION["\x75\x73\x65\162\137\x69\144"] ?? ''; goto XAbpz; cbnOB: $stmt->execute(); goto gNUNq; dvQ6L: if ($report_type == "\x6d\157\x6e\164\x68\x6c\x79") { $stmt->bind_param("\151\163\x73", $user_id, $date_filter, $date_filter); } else { $stmt->bind_param("\151\163", $user_id, $date_filter); } goto cbnOB; QBIlm: ?>
<script>function deleteRecord(e){confirm("Are you sure you want to delete this record?")&&console.log("Record with ID "+e+" will be deleted")}</script>

Function Calls

None

Variables

None

Stats

MD5 3f49f1f4c210e39a5974282a0c21180c
Eval Count 0
Decode Time 45 ms