5 Replies Latest reply on May 5, 2008 10:32 PM by (Dale_Andrew)

    Form submit to two places using toolbox transactions?

      I created a registration form in dreamweaver with developer's toolbox - it gets submitted to a mysql database. I have another form that submits info to my email list management company. It has the same first name and email form field names of the first form. It uses:

      post action="http://app.icontact.com/icp/signup.php" name="icpsignup"

      It submits to the email list site (I assume visitors would be leaving site temporarily) and then redirects back to a page on my site.

      I'm trying to figure out how to get the forms integrated using the easiet method so that at submit, the data goes to my database and to my email list company at the same time. I guess my main curiosity is getting the emial list form to submit the fields (most of them hidden) to the list company without sending the unrelated fields of the form. Also, how the heck do I get one form to submit to two places. Any ideas would be greatly appreciated.
        • 1. Re: Form submit to two places using toolbox transactions?
          Level 1
          Oops - my last post got cut off, but I fixed it. Also, the email list form is a completely seperate form than the dreamweaver form which submits to the mysql databse.Thanks for any help.
          • 2. Re: Form submit to two places using toolbox transactions?
            Günter Schenk Level 4
            Hi Dale,

            ------
            Also, how the heck do I get one form to submit to two places
            ------

            you could have your main form´s firstname and email values inserted into that other table by using a Custom Trigger (type AFTER) like this:

            ----------
            $firstname = KT_escapeForSql($tNG->getColumnValue("firstname"));
            $email = KT_escapeForSql($tNG->getColumnValue("email"));

            $query = "INSERT INTO tablename (firstname, email) VALUES("".$firstname."", "".$email."")";
            $insert_result = $tNG->connection->execute($query);
            if(!$insert_result) {
            $insertError = new tNG_error("Error inserting values into secondary table",array(),array());return $insertError;
            } else {
            return NULL;
            }
            -------

            Cheers,
            Günter Schenk
            Adobe Community Expert, Dreamweaver
            • 3. Re: Form submit to two places using toolbox transactions?
              Level 1
              Günter,

              Thanks for the help "again."

              Just wanted to make sure I was clear - these are two completely different sites. The registration form sumbits to a database on my server, and the email form values would need to submit to another different site (my email list management company). Would this work with the method you are describing?

              Dale
              • 4. Re: Form submit to two places using toolbox transactions?
                Günter Schenk Level 4
                Hi Dale,

                the code I posted will regretfully not submit to an external site, because it uses the existing "connection" defined for your main website, means it will insert into your site´s database and not an external one that´s located on a different server -- maybe this would be possible when establishing a secondary connection file that´s pointing to an external database, but that´s pretty experimental, and not all hosts allow that sort of "cross domain" database access.

                Is your secondary "submit to the email list site" form defined as "redirect after insert" URL for your main form ? In this case you could add the "firstname" and "email" values to this URL (using ADDT´s Dynamic Data) and have those URL parameters displayed in the secondary form´s hidden field´s values (e.g. $_GET['firstname']), so users won´t have to insert them once again.

                Cheers,
                Günter Schenk
                Adobe Community Expert, Dreamweaver
                • 5. Re: Form submit to two places using toolbox transactions?
                  Level 1
                  Günter,

                  Thanks for the advice with getting the values in there.

                  Dale