3 Replies Latest reply on Apr 15, 2010 3:33 PM by tomigee10

    Sending a brief email after data is posted to a MySQL database?

    tomigee10 Level 1

      Hi.

       

      I have successfully created a form that writes the results to a MySQL database. I have some simple email code on the thank you page that gets sent to the client after the form is submitted alerting them that a submission has been made.

       

      I would like the email to also contain just a couple of the form items that were filled in so the client can reference it in the backend system I have created, but I can't find a way to pass the form data like email, name and company to the thank you page so it will be populated in the email.

       

      I have tried a couple of hidden field "things" but none have worked.

       

      I would be grateful if someone could tell me how to pass several of the form field data to another page and end up in an email while not messing up the posting to the MySQL database.

       

      Or a better way to do this!

       

      Thank you in advance for your thoughts.

       

      Tom

        • 1. Re: Sending a brief email after data is posted to a MySQL database?
          Brad Lawryk Adobe Community Professional & MVP

          It can be done if you know some PhP coding. But if not (like me), I use a DW Extension from Webassist.com for this. Very easy to use and completely customizable.

           

          Brad Lawryk
          Adobe Community Professional: Dreamweaver
          Northern British Columbia Adobe Usergroup: Manager

          • 2. Re: Sending a brief email after data is posted to a MySQL database?
            Level 4

            without mentioning your server side scripting language you can set session variables for the posted items and retrieve them in your thank you page script to send in an email or use the for POST values if they are only passed through one page (since POST values are destroyed after more than one page load and thus must be converted to session variables)

             

            If the visitor is logged in then you can theoretically query their submitted values from a filtered recordset and add them to the email message through the query.

            • 3. Re: Sending a brief email after data is posted to a MySQL database?
              tomigee10 Level 1

              I had forgotten about that.

               

              Using my DW CS3 book I bought it had a section on Session Variables.

               

              I tried adding this code:

               

               

              <?php if (!isset($_SESSION)) session_start(); ?>

              <?php $_SESSION['email'] = $row_recordsetname['email']; ?>

               

               

              but it didn't pass the email address to the thank you page - at least it didn't end up in my email response.

               

              And then I assume if I get the coding correct, I would add the session start line to the thank you page as well for the email to collect the info?

               

              Thank you!

               

              Message was edited by: tomigee10