From start date plus number days = end date

epsdaniel 20 Feb, 2010
I have a form where you choose start date (date pick) and end date (date pick as well). I pass those parameters to the redirect url and works perfect.

I need a change and do not know how to do it.

Start date - date pick (calendar)
Nº days - dropdown number of days

And need to write the result in a hidden field to pass to the url.

End date (hidden): Start date + nº days

Thanks so much!!
epsdaniel 22 Feb, 2010
I have already done it. Thanks so much.

I finish do it with this code and works

function sumaDia($dtd,$dias1)
{ list($day,$mon,$year) = explode('/',$dtd);
return date('d/m/Y',mktime(0,0,0,$mon,$day+$dias1,$year));
}

$dth = sumaDia($dtd,$dias1);
This topic is locked and no more replies can be posted.