this thing is killing me....
this is a partial script that should add a month, 3 months, etc depending on what the user chooses, to todays date so that i can insert it into a mysql table. it keeps returning todays date! arghhhh....i'm going crosseyed looking at this thing. help....
$today = getdate();
$exp_yr = $today['year'];
$exp_month = $today['mon'];
// calculate expiration date
switch($bill_cycle)
{
case "monthly":
$exp_month = $exp_month+1;
break;
case "quarterly":
$exp_month = $exp_month+3;
break;
case "bi-annually":
$exp_yr = $exp_month+6;
break;
case "annually":
$exp_yr = $exp_yr+1;
break;
}
// add leading 0 to single-digital numbers
if(strlen($exp_month)==1)
{
$exp_month_array = array("0", "$exp_month");
$exp_month = implode("", $exp_month_array);
}
$exp_day = $today['mday'];
if(strlen($exp_day)==1)
{
$exp_day_array = array("0", "$exp_day");
$exp_day = implode("", $exp_day_array);
}
// checks if month goes beyond 12
if($exp_month > 12)
{
$exp_month = $exp_month-12;
$exp_yr=$exp_yr+1;
}
// put expiration info in an array
$exp_date_array = array("$exp_yr", "$exp_month", "$exp_day");
// set expiration date
@ $cust_expiration_date = implode("-", $exp_date_array);