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

Reply

Join Date: Oct 2003
Posts: 85
Reputation: g0rb4ch3v is an unknown quantity at this point 
Solved Threads: 0
g0rb4ch3v g0rb4ch3v is offline Offline
Junior Poster in Training

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

 
0
  #1
Jun 12th, 2005
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?
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 354
Reputation: Troy is an unknown quantity at this point 
Solved Threads: 5
Troy's Avatar
Troy Troy is offline Offline
Posting Whiz

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

 
0
  #2
Jun 12th, 2005
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.
Troy Wolf is the author of SnippetEdit. "Website editing as easy as it gets." IX Web Hosting
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC