We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25772
    • 35 Posts
    I want to click on a link that opens a pop-up window containing more information (taken from of a database). To do this I need to pass the index of the record to the new page to generate the content. In the old days, I just added ?index=somenumber to the link source and picked that up on the next page with $index. I can still add the ?index etc, but can’t pick it up on the new page.

    I must have missed something really basic here.

    Thanks

    RuthEd
      • 27376
      • 576 Posts
      You need to use the $_GET[] array. When you used $index in the past you had an option enabled known as [tt]register_globals[/tt] which has some many security holes.

      You would access ?index=blah in PHP as $_GET[’index’].
        • 33372
        • 1,611 Posts
        You can still pass variables in your query strings in MODx just like anywhere else. It sounds as if maybe you now have register_globals set to OFF (which you certainly should; leaving it ON is a huge security risk), and you’re not looking for the passed variable in the $_GET array. Try using $_GET[’index’] in your script instead of $index and it should work as you expect it to (see this link for a more complete explanation).
          "Things are not what they appear to be; nor are they otherwise." - Buddha

          "Well, gee, Buddha - that wasn't very helpful..." - ZAP

          Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
          • 25772
          • 35 Posts
          Thanks for the really quick answers - worked fine. I was obviously looking in the wrong place for the answer - if I had been more on the ball, I might have looked on php.net as well as the modx site.

          Thanks again.

          RuthEd