944,183 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1296
  • PHP RSS
Jun 12th, 2005
0

I'm looking for a certain type of script (desc. within)

Expand Post »
Ok here is what I want to do:

I am going to have a "6 upcoming events" (baseball games) section on my website but I want to be able to enter all of the games on one day and have it show the 6 upcoming games on the website. The thing Is I want to able to enter them all and ignore the ones that have already happened (a date will be one field I am entering). Has anyone seen a script that could help me with this?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
g0rb4ch3v is offline Offline
85 posts
since Oct 2003
Jun 12th, 2005
0

Re: I'm looking for a certain type of script (desc. within)

The first thing that came to my mind was a javascript solution, but here is a php solution:
[PHP]
<?php

if (date('Y-m-d',strtotime('6/1/2005')) >= date('Y-m-d',time())) {
echo "<br />June 1: Game 1, blah, blah, blah";
}

if (date('Y-m-d',strtotime('6/15/2005')) >= date('Y-m-d',time())) {
echo "<br />June 15: Game 2, blah, blah, blah";
}

if (date('Y-m-d',strtotime('7/03/2005')) >= date('Y-m-d',time())) {
echo "<br />July 3: Game 3: blah, blah, blah";
}

?>
[/PHP]

You could also do a DHTML solution where you place each game within a DIV or SPAN. Give each DIV or SPAN an id equal to the game date. Then have a javascript fire onload that looks at all the DIVs or SPANs and if date is less than today, set (element).style.display="none";

PHP solution means you don't have to worry about any browser compatibility issues.
Reputation Points: 36
Solved Threads: 6
Posting Whiz
Troy is offline Offline
354 posts
since Jun 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Help With Contact Us Form!
Next Thread in PHP Forum Timeline: Tabs causing errors





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC