I want to add 'x' number of days to current date. The days will be select by user and add to current date. Below is my select days code
<html>
<head>
<meta charset="UTF-8">
<title>Date</title>
</head>
<body>
<form name=date method="post" action="test.php">
<table style="width: 60%;">
<tr>
<td colspan="2" align="center"><h3>Date</h3></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>No. of Days</td>
<td>
<select name="days" style="width: 270px">
<option value ="Select">Select</option>
<option value="7">7</option>
<option value ="14">14</option>
<option value ="21">21</option>
<option value ="28">28</option>
</select>
</td>
</tr>
<tr align="center">
<td><input type='submit' value='Submit'></td>
<td><input type='reset' value='Reset'></td>
</tr>
</table>
</form>
</body>
Below is the code after submit
<?php
$date = date("Y-m-d");
$days = $_POST["days"];
echo date('Y-m-d', strtotime($date . ' + '. $_POST["days"]));
?>
But the results will always show as "1970-01-01"
Hope to get some tips. Thanks in advance