This is my Form
<div id="dateSelectors" >
<form action="#" method="post" style="display:inline">
<label for="fromDate">From : </label>
<input type="text" name="fromDate" class="datepicker"/>
<label from="toDate">To : </label>
<input type="text" name="toDate" class="datepicker"/>
<input type="submit" value="Go" class="add_btn" id="go_btn" name="go_btn"/>
<input type="submit" value="View All" class="add_btn" id="viewAll" name="viewAll"/>
</form>
</div>
And this is my php code in same page:
if(isset($_POST['go_btn'])){
$stmt;
if(isset($_POST['toDate']))
$to=date('d/m/Y',strtotime($_POST['toDate']));
if(isset($_POST['fromDate']))
$from=date('d/m/Y',strtotime($_POST['fromDate']));
}
When i fill the field Like this From:01/07/2014 To:21/07/2014.
I get: echo $_POST['fromDate'] as 01/07/2014. but $_POST['toDate'] as 01/01/1970. Please help me on this.