Jump to content

Archived

This topic is now archived and is closed to further replies.

dad47466

Day of the year

Recommended Posts

I have been unsuccessful in coming up with a script that will display a different page each day of the year.

I could use any assistance offered.

Share this post


Link to post
Share on other sites
What do you mean?
Something like this?

[code]<?php

echo "Yay! It's day number ".date("z")."!!!";

?>[/code]

Orio.

Share this post


Link to post
Share on other sites
I have a php file for each day of the year - 0101.php for Jan 1; 0102.php for Jan 2; 0103.php for Jan 3, etc.

I need to bring up January 1st's page on January 1st within a predesigned template.

The site is http://www.springfieldohio.net - and the features in question are"Birthdays" and "Almanac".  Right now, I'm using Java Script redirects - one to select the month, then a second to select the day.  The results open in a new window. 

I am trying to get the results to open in the content section of the page, but the js redirects are not doing it.

I have tried I-frames, but IE inserts scrollbars within the template, and it looks stupid.

I found this:

<?php
$date = date("md");

$handle=opendir('events');
while (($file = readdir($handle))!==false) {
 
    if ($file >= $date) {
        include("events/$file");
        }
}
closedir($handle);
?>

on webdesigns1.com - it places all 366 files within the template.

And changing the argument to if ($file = $date) produces nothing.  I also tried about a dozen different adjustments but with no positive results.

Share this post


Link to post
Share on other sites
= is the assignment operator, == is the equality operator

if ($file =[b][color=red]=[/color][/b] $date)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.