PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am trying to determine a date via a date from PayPal IPN.
I am updating a clubs site that shows a member list, in that member list each member will have a date that there membership expires. For simplicity reasons ALL members memberships expire 1/1/xx But... The year will depend on when they register, if they register in the first 2/3 of the year there membership will expire that year. But if they register in the last 1/3 of the year they will gut the rest of the year and all of next year.
For instance any membership received 1/106 through 9/30/06 will expire on 1/1/07
But any membership received 10/1/06 through 12/31/06 will expire on 1/1/08
<?PHP
// this is when we check to see when the membership is up
$today = date("F j, Y"); // We need a date! format as, March 10, 2001
$month = date("n"); // this tells us what month it is
$end_thisYear = date('Y',strtotime('+1 year')); // add one year to the date since technaly they expire on the first day of "next" year
$next_year = date('Y',strtotime('+2 year')); // add two years to the date since technaly they expire on the first day of "next" year
if ($month < 10) //if they join before October they get the rest of this year only
$mem_expire = $end_thisYear;
else
$mem_expire = $next_year; //if they join on or after October they get the rest of this year and all of next
// start message to user
echo ("<p>Your payment, and your membership renewal is compleate.</p>");
echo ("<p>Todays Date: $today <br /></p>");
echo ("<p>Membership expires on <span class=\"style1\">January 1st $mem_expire</span></p>");
echo ("<p> </p>");
echo ("<h2>Thank You</h2>");
?>