We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37044
    • 68 Posts
    Hi I am having trouble getting PHP native $_GET to work which I guess is attributed to me using seo friendly urls.

    So my set up is I post a form to a different document and it process some stuff then redirects the user back to a page using header location and then the page in turn 'should' display a message using $_GET

    So the form processing page will redirect back to http://www.mysite.co.uk/page?message=success

    But if I include a snippit that basically says

    <?php if($_GET['message'] == "success") {echo"Got Success";} ?>

    Nothing happens.

    Any suggestions greatly welcomed!

    Thanks

      • 16278
      • 928 Posts
      Basic steps to debug:
      - check your snippet is being called at all. Insert
      return 'Here I am';
      as the first line

      - check what it's receiving. Insert
      return print_r($_GET);
      as the first line

      Avoid using echo - it's always better to use return to print your snippet output. (In Evo; apparently the guideline in Revo is never use echo in a snippet.)

      I use redirects with query strings and FURLs with no problems (in Evo). I use the API call sendRedirect() rather than header() function - less chance of a typo spoiling things.

      :) KP [ed. note: kp52 last edited this post 15 years ago.]