Difference between two dates (in days) from now until (enter a date)
<form name="form1" method="post" action="">
<p>
<input type="text" name="date">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
$val = $_POST['date'];
/* gets date, converts to timestamp, minus today's timestamp, maths for day. DOESN'T WORK PRE 1971 */
$days = (strtotime("$val") - strtotime(date("Y-m-d"))) / (60 * 60 * 24);
/* rounds up to the day */
echo round ($days);?>