We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34178
    • 212 Posts
    Does anybody know if it is possible to use $_GET in Hooks? We were only successful using $_GET in preHooks but not in Hooks and we could not find the reason in our script what we maybe did wrong. Does anybody have an idea? The code of the hook is:

    <?php
    $resId = $_GET["l"];
    
        $props = array(
        'debug' => '0',
        'hideOutput' => '0',
        'message' =>  $_GET["l"] ,
        'subject' =>  $resId ,
        'to' => '[email protected]',
        'fromName' => 'Name',
        'emailSender' => '[email protected]',
        'html' => '1',
        'errorHeader' => '
    Mail error:',
        'smtpErrorHeader' => '
    SMTP server report:',
    );
    $output =  $modx->runSnippet('QuickEmail',$props);
    return $output;


    Maybe we can use $_GET in a preHook and transfer the value afterwards to the Hook? Are such 'value-transfer' from preHooks to Hooks possible? Maybe by session variables or by fields of the form?
      • 34178
      • 212 Posts
      By the way: The goal of this webpage is to send people who discontinued a multi-stage shopping-cart/-process a link by email to resume their once started shopping-process. The link contains two variables: 1. the 'id' to update the correct row of the database and 2. a specific 'control-code' which is to ensure that nobody else than the owner of the link can resume the certain shopping-process.

      Is this a good way for resuming a online-shopping-tour or is it recommend to use other ways (more safe ones) for this purpose? Is there anybody who solved this problem before in MODx?

      Letti