Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 02-12-2009, 02:30 PM birthday reminder
Junior Talker

Posts: 3
Trades: 0
Hi
I would like to set up a php birthday reminder so that if users bdays are within the 7 days, it should display that the folllowing people celebrate their bday next week so far i have got to this stage, does any one have a better idea?
if(!empty($_POST)){

function birthday ($birthday){

list($year,$month,$day) = explode("-",$birthday);
$year_diff = date("Y") - $year;
$month_diff = date("m") - $month;
$day_diff = date("d") - $day;

if ($day_diff < 0 || $month_diff < 0)
$year_diff--;
return $year_diff;

}
Any ideas will be wolcomed on how I can complete the rest of this code! all I would like is to see which friends or users have their bday in the next 7 days and their age if possible!!
samjones2005 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-13-2009, 12:42 PM Re: birthday reminder
Skilled Talker

Posts: 79
Location: Devon, England
Trades: 0
What about using this to match if a birthday is within 7 days time?

PHP Code:

if (mktime(000$month$day 7$year) > time(){
    echo 
'Your birthday is soon: '.$day.'/'.$month.'/'.$year;

__________________
Please add to my Talkupation if I was helpful. Thanks.


Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

Last edited by paaaaaaaaaa; 02-13-2009 at 12:43 PM..
paaaaaaaaaa is offline
Reply With Quote
View Public Profile Visit paaaaaaaaaa's homepage!
 
Old 02-15-2009, 12:01 PM Re: birthday reminder
Junior Talker

Posts: 3
Trades: 0
Okay will try this code
Thanx
samjones2005 is offline
Reply With Quote
View Public Profile
 
Old 02-20-2009, 07:39 AM Re: birthday reminder
Novice Talker

Posts: 7
Name: yolly
Trades: 0
Try this concept:

$date = 'birth day' - 7;

if ($date == 'current day')
{
'then statement here'
}
yollyP is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to birthday reminder
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19053 seconds with 12 queries