I'm inserting into a col 'EndRun' with format of 0000-00-00 on a single insert form. This shows an expiration date.
'StartRun' is entered manually from textfield, any future date and it's being inserted as it should
'Runtime' is from drop menu and is numeric representing days
(ex: 30) This is added to 'StartRun' to get the 'EndRun' value.
Problem is the code wants to add to years, and not days as it should. For example:
30 //Runtime
2004-07-11 //StartRun
2034-07-09 // inserts incorrectly for End Run
date('Y-m-d',(mktime(0,0,0,substr($HTTP_POST_VARS['StartRun'],5,2),substr($HTTP_POST_VARS['StartRun'],8,2), substr($HTTP_POST_VARS['StartRun'],0,4)) + mktime(0,0,0,0,$HTTP_POST_VARS['Runtime'],0)))
What is wrong here?