Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Is this possible in PHP/JavaScript?

Name: Anonymous 2007-12-28 10:56

I am making two pages.  The first one displays a picture depending on the day - so if it's January 10 2008, the displayed pic is 2008-01-10.jpg

Next, I want to make a calendar, with each day linking to the appropriate pic of the day.  However, I want to make it so it's impossible to view pics before their day, either by not making them hyperlinks, or by making it so nothing happens when they are clicked on.  Problem is, I have no clue as to how to approach this problem aside from making 365 if-else blocks.

Any ideas?

Name: Anonzz 2007-12-29 13:22

We assume you have 365(6) images one for each day..., simple use a img src to this script, it will only display the current days image and they won't be able to find the url (gets around just using the header function).

<?php
$date = date("Y-m-d");
$folder = 'calimages/';
$open = fopen($folder.$date, 'r');
while ($read = fread($open, 4094)) {
$data .= $read;
}
fclose($open);
header('Content-Type: image/png');
echo $data;
exit;
?>

That should do it, you may need to change some things or fix a bug or two as thats written off the top of my head.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List