Jump to content

birthday calc script help


the-botman

Recommended Posts

hi guys...

 

ok i need some help but then again whats new lol, ok what i need this part of the code to do is calc the day the user was born, the day the next birthday falls on and the age of the user, Note: it gives me the next birthday day.

this is the code i have now but its not working

if (Get_QString('Post') == "True") {
$Date_Day = GetPost('Day');
$Date_Month = GetPost('Month');
$Date_Year = GetPost('Year');  
$h = mktime(0, 0, 0, $Date_Month, $Date_Day, $Date_Year); 
$d = date("F dS, Y", $h) ; 
$w= date("l", $h) ;
$Birthday= date("-l", $h) ;
echo '<div class="hd2"><center><font color=#666666><strong>Day you were Born</strong></font></center></div><br>'."\n";
echo '<font face="Verdana" size="2">You were born on a: <b>'.$Birthday.'</b></font><br>'."\n";
echo '<font face="Verdana" size="2">You Your Next Birthday falls on a: <b>'.$w.'</b></font><br>'."\n";
echo '<font face="Verdana" size="2">You Are now: <b>'.$Age.'</b></font><br>'."\n";

Link to comment
https://forums.phpfreaks.com/topic/202564-birthday-calc-script-help/
Share on other sites

this is were i am now

	$Date_Day = GetPost('Day');
$Date_Month = GetPost('Month');
$Date_Year = GetPost('Year'); 
     $Year="
$hour = "23";  
$h = mktime(0, 0, 0, $Date_Month, $Date_Day, $Date_Year); 
$d = date("F dS, Y", $h) ; 
$w= date("l", $h) ;
$Birthday= date("-l", $h) ;
$hour="00";
$minute="00";
$second="00";
$Year= date("Y");

$time=mktime($hour, $minute, $second, $Date_Month, $Date_Day, $Year, -1);
$today = time();
$difference = $time - $today;
if ($difference < 0) $difference = 0;
$days_left = floor($difference/60/60/24);


echo '<div class="hd2"><center><font color=#666666><strong>Day you were Born</strong></font></center></div><br>'."\n";
echo '<font face="Verdana" size="2">You were born on a: <b>'.$Birthday.'</b></font><br>'."\n";
echo '<font face="Verdana" size="2">You Your Next Birthday falls on a: <b>'.$w.'</b></font><br>'."\n";
echo '<font face="Verdana" size="2">You Are now: <b>'.$Age.'</b></font><br>'."\n";
echo '<font face="Verdana" size="2">There are: <b>'.$days_left.'</b> left Untill your birthday</font><br>'."\n";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.