Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
if(isset($_POST['export'])) { $query = Database::prepare("SELECT..
Decoded Output download
<? if(isset($_POST['export']))
{
$query = Database::prepare("SELECT * FROM hotel_rooms");
$query->execute();
$emparray = array();//
while($row = $query->fetchAll())
{
$emparray[] = $row;
}
$res = json_encode($emparray, JSON_FORCE_OBJECT);
// $temp = tmpfile('');
// fwrite($temp, $res);
// fseek($temp, 0);//
// echo fread($temp, 1024); //-
//
ob_end_clean();
$file = __DIR__ . '/export.json';
$file_n = fopen($file, 'w');
fwrite($file_n, $res);
// fclose($temp); //
//
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream'); //application/octet-stream
header('Content-Disposition: attachment; filename=' . basename($file));
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($file));
readfile($file);
exit();
} ?>
Did this file decode correctly?
Original Code
if(isset($_POST['export']))
{
$query = Database::prepare("SELECT * FROM hotel_rooms");
$query->execute();
$emparray = array();//
while($row = $query->fetchAll())
{
$emparray[] = $row;
}
$res = json_encode($emparray, JSON_FORCE_OBJECT);
// $temp = tmpfile('');
// fwrite($temp, $res);
// fseek($temp, 0);//
// echo fread($temp, 1024); //-
//
ob_end_clean();
$file = __DIR__ . '/export.json';
$file_n = fopen($file, 'w');
fwrite($file_n, $res);
// fclose($temp); //
//
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream'); //application/octet-stream
header('Content-Disposition: attachment; filename=' . basename($file));
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($file));
readfile($file);
exit();
}
Function Calls
None |
Stats
MD5 | d8eea43d644f69880b119dd1db77568c |
Eval Count | 0 |
Decode Time | 60 ms |