Jump to content


Photo

Day of the year


  • Please log in to reply
4 replies to this topic

#1 dad47466

dad47466
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 26 September 2006 - 03:29 AM

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.

#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 26 September 2006 - 04:56 AM

What do you mean?
Something like this?

<?php

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

?>

Orio.
Think you're smarty?

(Gone until 20 to November)

#3 dad47466

dad47466
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 26 September 2006 - 10:32 AM

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.



#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 26 September 2006 - 10:48 AM

= is the assignment operator, == is the equality operator

if ($file == $date)
Legend has it that reading the manual never killed anyone.
My site

#5 dad47466

dad47466
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 26 September 2006 - 11:06 AM

Dumb mistakes happen all the time.

It's working.  Thanks.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users