Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Birthday Script

Status
Not open for further replies.

digatle

Technical User
Joined
Oct 31, 2003
Messages
85
Location
US
I'm interested in making a birthday block for my client's site. I want it simple and basic. Based on the system clock is what day it is. Look at the MySQL server for someone's birthday that matches today. If they do put in the following information:

--------------
Happy Birthday
--------------
11/1 - Judy Guess
11/1 - Sam Wise


If no one's birthday is today it looks like:

--------------
Happy Birthday
--------------
No one's birthday today.



I want the admin part of this to be just as simple and basic:

--------------
Birthday Admin
--------------
Add Birthday
Edit Birthday
Remove Birthday


Is there a script out there that does this at a basic level? I've seen a lot of scripts out there that incorporate a birthday block in some package (osCommerse, phpNuke, so forth) but I'm not doing their package. Any suggestions?
 
digatle,

THIS should give you an idea howto do it in PHP:

Code:
<HTML>
<?
  function celebrate($birthday) {
    $today = getdate();
    if(($birthday[day]==$today[&quot;mday&quot;]) && ($birthday[mon]==$today[&quot;mon&quot;]))
      return true;
    else
      return false;
  }
    
  /* Let's test it now... */

  $joe[day] = 1;
  $joe[mon] = 11;

  if(celebrate($joe))
    echo &quot;Let's party!&quot;;
  else
    echo &quot;Maybe tomorrow then!&quot;;
?>
</HTML>

Good luck


Jakob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top