View Single Post
  #2  
Old 5th Jan 04, 06:14 PM
SlickVic78's Avatar
SlickVic78 SlickVic78 is offline
Senior Member
 
Join Date: Sep 2001
Location: New York, USA
Posts: 515
SlickVic78 is an unknown quantity at this point
Hey JacKDynne,

So your code right now will post from this year and up, not past years correct?

The issue falls within this statement:

Code:
for ($x=$currYear; $x<($currYear+5); $x++)
You have set $x to equal the current year, you set your limit to have $x be less than 5 years after the current year, and you set your counter to always increment by 1.

If you were to set the limit to look like this $x<($currYear-5), this still doesn't work (as you already noticed), because the current year has already succeeded the limit (being you are comparing the current year,($x, with being less than 5 years before the current year) which makes this statement already false, therefore, no years should have been posted when you have tried that out...

I think what you can do is this, to get at least 5 years before the current year:

Code:
for ($x=$currYear-5; $x<($currYear+5); $x++)
This way you set $x to being 5 years before the current year and the limit should be 5 years after the current year.

See if this helps, if not, let me know and I'll look into it further...

-SlickVic78
__________________
  • Pentium 4 3.20GHz Processor
  • 1 Gig DDR 400MHz RAM
  • 100 Gig 7200 RPM Western Digital HDD
  • 80 Gig 7200 RPM Western Digital HDD
  • Lite-On LTR-52327S CD-RW Burner
  • Lite-On SOHW-1633S DVD Burner
  • ATI Radeon 9700 Pro
  • Sound Blaster Audigy
  • Microsoft Windows XP Pro SP-2
Reply With Quote