I have a php page that is supposed to load a random image from the folder it is in
<?php
error_reporting(0);
header("Content-Type: image/jpg");
$d = scandir('.');
foreach($d as $f)
if(substr($f,-4)==".jpg")
$fs[] = $f;
readFile($fs[rand(1,count($fs))-1]);
?>
Why is this not working. I have checked that there are valid images, and i have seen this exact same script work on a personal server of the person who made it
my domain name is savetree.heliohost.org
this php is called avatarscript.php and is in the public_html directory