Hi,
I'm using the following code to display a random image per week but can't get it to display the image. It was working but I changed something and now it does not display the images. I also would like to add a link to the image. What am I doing wrong?
<?php
//first of all, get the week:
$d = date("z,w"); // day of year (0..364), day of week (0 Sunday .. 6 saturday)
list($dy,$dw) = explode(",", $d);
$week = intval(($dy-$dw)/7);
if(($dy-$dw)%7) ++$week;
// this calendar starts weeks on sundays, the first partial week is counted
// next, read the file
$images = file('imagelist.txt'); // one image per line
$thisimage = preg_replace("{\r?\n}", "", $images[$week]);
echo "<img src=$thisimage>";
$images1 = file('imagelist1.txt'); // one image per line
$thisimage1 = preg_replace("{\r?\n}", "", $images1[$week]);
echo "<img src=$thisimage1>";
?>


