SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Oct 2007
    Location
    United Kingdom
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $_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:

    HTML 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:

    PHP Code:
        $date1 $_GET['date_from'];
        
    $date2 $_GET['date_to'];
        echo 
    "date1: $date1,<br>date2: $date2"
    Any ideas???

  2. #2
    SitePoint Member
    Join Date
    Oct 2007
    Location
    United Kingdom
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SOLVED

  3. #3
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,011
    Mentioned
    57 Post(s)
    Tagged
    0 Thread(s)
    Share your solution please. Otherwise, you'll frustrate someone in the distant future....

  4. #4
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,788
    Mentioned
    153 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Michael Morris View Post
    Share your solution please. Otherwise, you'll frustrate someone in the distant future....
    AWESOME!!!!!!!!!!!!!!!!!!!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  5. #5
    SitePoint Member
    Join Date
    Oct 2007
    Location
    United Kingdom
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The second GET request was being reset by this following IF statement SOMEHOW...

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


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •