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

    Please a need you assitence for a problem with a variable...
    I have a search webform and when i submit i go for one page that show the result with pagination and when I click for to go the page 2 I lost the variable value.... but if I put the page with cache this page don’t update....

    I need to know how i save the value of the variable for I can go for the next pages?

    Thank you
      • 10487 MODX Staff
      • 1,535 Posts
      You’ll need to pass the variable value in the querystring along with the pagination parameters. And then, on the second page, you can access the variable via $_GET.

      You’ll definitely need to keep the snippet/page uncached for this to work.
        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com
        • 27449
        • 211 Posts
        Thank you for your answer.

        I try but doesn’t work...
        When I submit the form I have the values of the variables but when I go for the next page I lost all...

        http://oceanicowebprojects.oceanicogroup.com/real_estate/index.html

        In the form I put the method="get" and I call the variables for example : $_GET[’variable’]

        when I click on the next page I lost the values.

        I try to create a session but I don’t get...
          • 15083
          • 697 Posts
          Store your values in the $_SESSION[]
          MODx would not be working for you if there was a problem with the sessions on your host.
            • 27449
            • 211 Posts
            Hi,

            Please can you assist me to configure my server for to use $_SESSION

            I’m not getting to configure sad

            Thank you
              • 15083
              • 697 Posts
              Quote from: sjscosta at Sep 15, 2009, 08:48 AM

              Please can you assist me to configure my server for to use $_SESSION

              We will need a bit more info. Are you running MODx locally or are you on a shared/dedicated hosting box?
              If MODx is working, then your sessions are working!

              To store a value in your session (from inside a snippet call in MODx):
              $_SESSION[’mysessionvar’] = 10;
              The value 10 is now in the session variable "mysessionvar"

              To access this value from another page:
              $myvalue = $_SESSION[’mysessionvar’];
              echo $myvalue;

              Prints out the value of session variable "mysessionvar"
              Does this help?