...

View Full Version : adding days to a drop down



grudz
06-16-2005, 06:49 PM
Hi,

I have this code




$sm = $_POST['sent_m'];
$sd = $_POST['sent_d'];
$sy = $_POST['sent_y'];
$sent = "".$sy."-".$sm."-".$sd."";



that comes from 3 drop down boxes (month, day, year)

how do i take that info and add 30 days to it?

thank you

Serex
06-16-2005, 07:10 PM
<?php
$c_day = $_POST['sent_d'];
$c_month = $_POST['sent_m'];
$c_year = $_POST['sent_y'];

echo "Date Entered: " . $c_day . " / " . $c_month . " / " . $c_year . ".";

// add 30 days
$k_date = date("d / m / Y", mktime(0, 0, 0, $c_month, $c_day + 30, $c_year));

echo "<br><br>";
echo "End Date: " . $k_date;
?>

grudz
06-16-2005, 07:18 PM
Thanx alot! :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum