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
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’].
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).
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