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
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";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.