We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24071
    • 14 Posts
    Hi,

    I put the FlexSearchForm on a page.
    Then I perform a search.
    I take look at a result and hit the backbutton of my browser.

    It tells me the page is expired and I need to hit refresh to reload the page.

    Is there a way to setup FlexSearchForm so I can go back to my searchresults without the page expired warning and the need to hit refresh?

    Right now I have the form and the results on one page. Maybee this is not a smart solution?

    Thanks,
    purple
      Purple
      === Don’t forget to smile ===
      • 31342
      • 6 Posts
      Hi,

      I recently had this problem too, and although I know absolutely nothing in PHP I found out a small hack in FlexSearchForm to bypass this annoying error message. The problem is that FlexSearchForm uses the POST method to pass its search query, so reloading the page cannot pass the same parameters again. The trick is to make the snippet use the GET method instead, so that the parameters would be passed within the destination URL. Here’s how to do it:



      1) Make sure you make a backup copy of the FlexSearchForm snippet

      2) Edit the following section of the code:
      // establish form
      if (($validSearch && ($showSearchWithResults)) || $showSearchWithResults){
        $SearchForm .= '<form class="FSF_form" action="'.$searchAction.'" method="get">';
        $SearchForm .= ($xhtmlStrict)? '<fieldset><legend>Search</legend>' : '' ;
        // decide what goes in search box
        $searchBoxVal = ($searchString == '' && $boxText != '')? $boxText : $searchString ;
        $SearchForm .= '<input class="FSF_input" type="text" name="FSF_search" value="'.$searchBoxVal.'"  ';
        $SearchForm .= ($boxText)? 'onfocus="this.value=(this.value==\''.$boxText.'\')? \'\' : this.value ;" />' : '/>';
        $SearchForm .= '<input class="FSF_submit" type="submit" name="sub" value="'.$searchButtonText.'" />';
        $SearchForm .= ($xhtmlStrict)? '</fieldset>' : '';
        $SearchForm .= '</form>'.$newline;
      }
      


      When you’ll do a search query, the URL of the page will appear like that: "http://mysite.com/alias?FSF_search=myquery" and the web browser will then be able to send back the query when reloading the page, it won’t expire. Hope it will help.

      Regards,


      - Vince
        • 24071
        • 14 Posts
        Hi Vince,

        Thanks for your reply. It lost my focus long time ago smiley

        However, it is a smart idea. I think I wil use it.

        Thanks.
          Purple
          === Don’t forget to smile ===