$_GET not grabbing the correct detail. Although i can see it in the URI

Hello,

It appears one my gets is not grabbing the detail correctly for some reason.

Output of ECHO’D details equals grabbed via the $_GET:

date1: 2012-02-90,
date2: 1

URI = “…date_from=2012-02-09&date_to=2012-02-11…”

HTML FORM CODE:

<form name='refined_search' action='searchresults.php' method='GET'>

.....

<input type='text' name='date_from' id='' readonly size='12' onClick="displayCalendar(document.forms['refined_search'].date_from,'yyyy-mm-dd',this)">
<input type='text' name='date_to' id='' readonly size='12' onClick="displayCalendar(document.forms['refined_search'].date_to,'yyyy-mm-dd',this)">

.....

</form>

PHP CODE:

    $date1 = $_GET['date_from'];
    $date2 = $_GET['date_to'];
    echo "date1: $date1,<br>date2: $date2";

Any ideas???

SOLVED

Share your solution please. Otherwise, you’ll frustrate someone in the distant future…

AWESOME!!!

The second GET request was being reset by this following IF statement SOMEHOW…

 if($_GET['date_from'] && $_GET['date_to'] != null) {
    
    $date1 = $_GET['date_from']; 
    $date2 = $_GET['date_to'];