We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49846
    • 22 Posts
    Hello. I am trying to pass variable values in the URL using POST and GET methods. My Url is like this: http://mysite.co.uk/index.php?id=45&idnum=6&code=122345

    id=45 is by default, the id number of the resource page. My snippet is a HOOK in my formit form. I want to be able to store the user filling the form with the id and code in the URL into the database. The GET method successful returns the id of the resource page (this was for testing purposes), however when trying to retrieve the id and code, it returns as NULL. The extra variables that I have added to the URL are being ignored. Can someone please tell me this is possible with modx and where I am going wrong? Thanks
      • 49846
      • 22 Posts
      I have searched online and have had no luck. People suggested to edit the htaccess file. And to add [QSA] tot her rewrite rule. However my rewrite rule already has [L, QSA]....
        • 49529
        • 196 Posts
        Hi,
        please show your code. AFAIK MODX doesn't have any limitations on using $_GET or $_POST, they are treated in a regula PHP way and can be easily set/get from snippets or hooks.