We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33372
    • 1,611 Posts
    You can do it in only two steps, really, but I like placeholders so I’d do it in three. The first step is to save the values that you need in session variables (which don’t disappear from page-to-page). Session vars can be arrays (that just makes them multidimensional), so you can just add this one line to the end of your eForm2db function:

    $_SESSION['info']=$dbTable;
    


    Then you can just create a snippet that will output the info from your session variable and place that snippet on your gotoID page:

    $modx->setPlaceholder('Title', $_SESSION['info']['Title']);
    $modx->setPlaceholder('Name', $_SESSION['info']['Name']);
    // etc. for each value you want to display on this page
    unset($_SESSION['info']);  // just to clean up; this deletes the session variable
    


    And then you can use the placeholders on that page just by inserting them where you want them in your content, e.g.:

    Thank you, [+Title+] [+Name+]. We will reply to you at [+email+] shortly.
    
      "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
      • 25124
      • 54 Posts
      fantastic, I will give that a try now smiley
        • 25124
        • 54 Posts
        Ok here’s what I’ve done.

        I’ve changed the bottom or eForm2db to end like this

        		$dbTable['IP'] = $_SERVER['REMOTE_ADDR'];
        		$dbTable['Host'] = $_SERVER['REMOTE_HOST'];
        		$dbTable['Agent'] = $_SERVER['HTTP_USER_AGENT'];
        		// Run the db insert query
        		$dbQuery = $modx->db->insert($dbTable, 'aafeedback' );
        		return true;
        	}
        $_SESSION['info']=$dbTable;
        ?>


        Note the last line before the php close has been added.


        I’ve then added the &gotoid=`42` to the feedback form so on submit, the page goes to page ID 42

        I’ve created a snippet called form with the following code

        <?php
        $modx->setPlaceholder('Title', $_SESSION['info']['Title']);
        $modx->setPlaceholder('Name', $_SESSION['info']['Name']);
        // etc. for each value you want to display on this page
        ?>


        I’ve then altered the code in page Id 42 so it contains this (to call the snippet)


        <h2>The form's been submitted</h2>
        [[form]]
        <p>Dear [+Name+],</p>
        <p><b>We've sent a confirmation e-mail to you ............




        but I still don’t get the variables passed. i must be missing something here....

        Edit: I’ve changed [[form]] to [!form!] in the page id of 42 but still no difference. sad
          • 33372
          • 1,611 Posts
          The $_SESSION[’info’]=$dbTable; line needs to be inside your eForm2db function and before the return true; line.
            "Things are not what they appear to be; nor are they otherwise." - Buddha

            "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

            Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
            • 25124
            • 54 Posts
            Quote from: ZAP at Jun 15, 2008, 04:54 PM

            The $_SESSION[’info’]=$dbTable; line needs to be inside your eForm2db function and before the return true; line.

            Hurrah, with this mod it’s now working perfectly. grin
            I can’t thank you enough. Much appreciated.

            Now I can add my Goal code onto this page for the Analytics smiley
              • 33372
              • 1,611 Posts
              You’re welcome. That’s what these forums are for. Help out someone else here when you get a chance and everyone benefits.
                "Things are not what they appear to be; nor are they otherwise." - Buddha

                "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

                Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options