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

    I’m kinda new with ModX and I’m not really into PHP. I learn by try-and-mistakes while building my first web site.

    Now I’m trying to use the FlexSearchForm and I noticed that on Internet Explorer, when I press the back button from the results page, I get an error message saying that the web page has expired and I must refresh the page. I went to many web sites using ModX to see that every site has the same issue with IE... except one: the main ModX web site.

    I’d love to know the magic tricks of the ModX site webmaster.

    Thanks a lot!


    - Vincent
      • 8164
      • 51 Posts
      Actually, you’ll get this with most (not all, but most) pages on any site that are loaded based on user input. The "warning" is telling you that postdata was added to the page (in this case, the search term) and the browser can’t replicate that postdata, but it would be happy to reload the rest of the page from cache.

      I have seen postdata warnings in Yahoo mail, searches on CNN, in Amazon and a gazillion other places, so it’s not a MODx phenomena. Anytime you enter a search term, a username, etc. and try to reload the entry page with a back button, you stand a good chance of getting this browser message.

      Why some *don’t* do it is a mystery to me, frankly. The warning makes sense to me...failing to get it doesn’t, lol.

      Duane
        • 31342
        • 6 Posts
        Perhaps it’s due to the fact that the search request is done with the POST method, GET being used for passing parameters to ModX for the page id. I’m using SEF with alias and path to imitate a standard static html site, so I guess using the GET method is impossible. I did a stupid thing and tried to hack the snippet by replacing all the "POST" occurences by "GET" and I only had strange behavior produced.

        I’ve been using Joomla a little, and the search criteria were passed with GET and shown in the address bar. I don’t like the way Joomla works in the inside, but it’s made so many different parameters can be passed into the URI, compared with MODxwhich displays very clean URI but seems not allow passing custom parameters.

        Thinking of it, perhaps the only way to "fix" this issue is to pass search parameters using the GET method, and maybe the only way to allow this in ModX is to code the search engine into the core, switching the way parameters are managed when the page ID equals that of the the page designed as the search results. This would allow passing additional parameters, such as the search string. I’m not really in programming and I don’t know if this idea is stupid or impossible, just guessing.

        Or maybe even simpler. MODx seems to use the parameter "id" in the URI to generate the SEF path, but it seems the URI can contain more parameters (I tried to do a link with a dumb parameter, the SEF didn’t modify my request and the page loaded). So for exemple I can imagine a search form snippet which generate a GET request using a parameter "query=blahblah" to the search results page, which calls a second snippet doing the search using this param and displaying it. Unfortunately I can’t code because I don’t know any PHP, although I’m slowly learning. Would such idea would be possible to do?