What I am trying to achieve is basically the user will enter 2 dates and get back the difference in days. I have seen other related questions in SO but none answer my question.
Following is my code:
<html>
<head>
<?php
$startdate = $_POST['startdate']; // starting date
$enddate = $_POST['enddate']; // end date
$now = strtotime($startdate);
$your_date = strtotime($enddate);
$datediff = $your_date - $now;
$number = floor($datediff/(60*60*24));
?>
</head>
<body>
<form name="date_form" action="" method="POST"">
<input type="text" name="startdate" value=""/>
<input type="text" name="enddate" value=""/>
<input type="submit" name="submit_start" value="Submit" />
</form>
</body>
</html>
Please help in pointing what all changes I should make. Thanks in advance.