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

    AjaxSearch 1.7.1 / 1.8.2b and Modx 0.9.6.1p2

    I’m using non-ajaxsearch with a landing page.
    First I’m landing at the Results Page (1).
    I go to a result.
    But then I can not go back to the Results Page (1).
    The BACK button does not work. (Press Reload to resend that data and display this page...)
    Strange: This problem occurs only in IE6+7 and Chrome.

    URL Results Page (1): http://www.swisscam.com.br/search_results.html
    URL Results Page (2): http://www.swisscam.com.br/search_results.html?AS_offset=10&AS_search=swiss

    Strange: When I go from the Resultspage (1) to the Resultspage (2) and than back to the Resultspage (1)
    the URL of  the Resultspage (1) has "?AS_offset=0&AS_search=swiss" added.


    • How I can add "?AS_offset=0&AS_search=swiss" at the URL of the first result page (landing page) ?
    • Exists any simple FIX or any simple solution ?

    Thanks for any feedback! I’m not a programer.

    Markus

    P.S. 1: Pacient. Posted 2008 in German: http://www.modxcms.de/forum/comments.php?DiscussionID=1525&page=1#Item_0
    P.S. 2: Modx is a good concept.  I need a simple tool. I like fast sites. Congratulation Modx Team. All my sites have the disclaimer:

    Powered with  MODx - PHP Application Framework and
    Content Management System, licensed under the GPL license.
    © 2005-2008 MODx CMF Team.

    This is what I can do.
      www.01241.com
      • 7231
      • 4,205 Posts
      I think that this is a security function in IE and I guess Chrome also. But it is not related to AjaxSearch specifically but is related to user input being passed via $_POST rather than $_GET. Maybe you can simply edit the search form to use get rather than post as the method...not sure if AS ir prepared for both methods...but based on how well it is codded I would not be surprised. wink

        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 18402
        • 6 Posts
        Thanks for the input Shane, but this only this not works.

        I’m not alone with this question:

        On the demopage of Non-Ajaxsearch 1.8.2: http://www.modx.wangba.fr/index.php?id=257
        I search for "School" than landing on the resultspage id272.
        I click on the first result: "School is like a bicycle: if you don’t pedal, it topples"
        Now I am at page "...index.php?id=66&searched=school&advsearch=oneword&highlight=ajaxSearch_highlight+ajaxSearch_highlight1"

        AND NOW when I click on the Back-Button (chrome) appears the message:

        Confirm Form Resubmission
        This web page requires data that you entered earlier in order to be properly displayed. You can send this data again, but by doing so you will repeat any action this page previously performed. Press Reload to resend that data and display this page.

        That is not good.

        The Back-button is very important in my solutions.
        In my conception of Interfacedesign.

        Anywone can help.

        Thanks.

        Markus
          www.01241.com
          • 18402
          • 6 Posts
          Solved for 1.7.1 Thanks to Marc (and Shane for open my mind)

          Is there any problem change "POST" to"GET" ? Security?
          I want use AjaxSearch 1.8.2, but this is a bit more complex.
          And this solution is not very elegant.

          Marcs Code in the German Forum http://www.modxcms.de/forum/comments.php?DiscussionID=672&page=1#Item_0

          In the Snippet Code (line 294)
          if ( isset($_POST['search']) || isset($_GET['AS_search']) || isset($_GET['FSF_search'])) { 
          // Prefer post to get 
          if (isset($_POST['search'])) { 
          $searchString = $_POST['search']; 
          } elseif (isset($_GET['AS_search'])) { 
          $searchString = urldecode($_GET['AS_search']); 
          } else { 
          // Code to make tag cloud snippet work with this search 
          $searchString = urldecode($_GET['FSF_search']); 
          }

          change to
          if ( isset($_GET['search']) || isset($_GET['AS_search']) || isset($_GET['FSF_search'])) { 
          // Prefer post to get 
          if (isset($_GET['search'])) { 
          $searchString = $_GET['search']; 
          } elseif (isset($_GET['AS_search'])) { 
          $searchString = urldecode($_GET['AS_search']); 
          } else { 
          // Code to make tag cloud snippet work with this search 
          $searchString = urldecode($_GET['FSF_search']); 
          }


          and line 524
          } else if (!$validSearch && isset($_POST['sub'])) {

          change to
          } else if (!$validSearch && isset($_GET['sub'])) {


          /assets/snippets/AjaxSearch/includes/templates.inc.php
          <form [+as.formId+]action="[+as.formAction+]" method="post">

          change to
          <form [+as.formId+]action="[+as.formAction+]" method="get">


          In the last 2 years, this forum solved all my questions.
          I am with ModX cool
          I want participate more. I promise.
          The book is on the table.
            www.01241.com