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

    I have some code, which works on a normal php page. The code snippet created will find the $_GET['retval2'] but no if statements work in the snippet, it defaults to the else.

    myurl.com?retval2=survey

    <?php
    if($_GET['retval2'] == 'survey') { 
        $url = './BLOBSurveyVerify.php';
    } else { 
       $url = './BLOBFSBMemberVerification.php';
    }
    
    echo $url;
    


    using snippet

    [[quoteSurvey]]
    
      • 30585
      • 833 Posts
      Try
      return $url;
      instead
        A MODx Fanatic
        • 46006
        • 17 Posts
        Quote from: treigh at Oct 03, 2018, 09:25 AM
        Try
        return $url;
        instead

        Also, try calling the snippet uncached (by placing an '!' at the beginning), e.g. [[!quoteSurvey]]
          • 3749
          • 24,544 Posts
          Was the plain PHP file in the MODX directory? If not, maybe a rewrite rule in the MODX .htaccess file is missing the QSA directive to append the query string. It will still show in the URL, but won't be in the &_GET array.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 38783
            • 571 Posts
            Quote from: gavmodder at Oct 03, 2018, 07:01 AM
            Hi,

            using snippet

            [[quoteSurvey]]
            

            Unless it is just a typo in your forum post, the snippet should be preceded by an exclamation mark.

            [[!quoteSurvey]]
              If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

              email: [email protected] | website: https://andytough.com