correct the banner script based on how lainchan does it

Signed-off-by: natto1784 <natto@weirdnatto.in>
This commit is contained in:
2022-11-18 09:43:43 +05:30
parent c8f88c14a8
commit 103cc7d78e

8
b.php
View File

@@ -4,16 +4,16 @@ $files = scandir($dir);
$images = array_diff($files, array('.', '..')); $images = array_diff($files, array('.', '..'));
$name = $images[array_rand($images)]; $name = $images[array_rand($images)];
// open the file in a binary mode // open the file in a binary mode
$fp = fopen($dir . $name, 'rb'); $ext = pathinfo($name, PATHINFO_EXTENSION);
// send the right headers // send the right headers
header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1 header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1
header('Pragma: no-cache'); // HTTP 1.0 header('Pragma: no-cache'); // HTTP 1.0
header('Expires: 0'); // Proxies header('Expires: 0'); // Proxies
header('Content-Type: ' . $fp['type']); header("Content-type: image/" . $ext);
header('Content-Length: ' . $fp['bytes']); header("Content-Disposition: inline; filename=" . $name);
// dump the picture and stop the script // dump the picture and stop the script
fpassthru($fp); readfile($dir.$name);
exit; exit;
?> ?>