7 Replies Latest reply on May 9, 2006 7:20 AM by Jackeltree

    Form Processing

    Jackeltree Level 1
      I have created a php form and all is good (it looks good and the filled out form info is sent to my email address) except when I put code on the submit button to have it link to another page saying "thank you for submitting your question, etc" (I've tried creating that thank you page with both html and php extensions) the button sends the user to the thank you page, but the info isn't sent to my email.

      This is the code I used for the submit button to get it to link to the thank you page (which is named test2.php). This code brings me to the thank you page like it's supposed to, but fails to send the info to my email:
      <input type="submit" name="submit" id="submit" value="Submit" onclick="MM_goToURL('parent','test2.php');return document.MM_returnValue"/>

      This is the code I used on the submit button that worked as far as sending the form information to my email, but obviously there's nothing there that will send the user to a thank you page:
      <input type="submit" name="submit" id="submit" value="Submit" />

      What am I doing wrong here? Any help is appreciated, thank you.

      -Crystal
        • 1. Re: Form Processing
          Level 7
          This will not work. The redirect to thank you must be done by the script
          that processes the form.

          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.dreamweavermx-templates.com - Template Triage!
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
          ==================


          "Jackeltree" <webforumsuser@macromedia.com> wrote in message
          news:e3o88u$i4p$1@forums.macromedia.com...
          >I have created a php form and all is good (it looks good and the filled out
          > form info is sent to my email address) except when I put code on the
          > submit
          > button to have it link to another page saying "thank you for submitting
          > your
          > question, etc" (I've tried creating that thank you page with both html and
          > php
          > extensions) the button sends the user to the thank you page, but the info
          > isn't
          > sent to my email.
          >
          > This is the code I used for the submit button to get it to link to the
          > thank
          > you page (which is named test2.php). This code brings me to the thank you
          > page
          > like it's supposed to, but fails to send the info to my email:
          > <input type="submit" name="submit" id="submit" value="Submit"
          > onclick="MM_goToURL('parent','test2.php');return
          > document.MM_returnValue"/>
          >
          > This is the code I used on the submit button that worked as far as sending
          > the
          > form information to my email, but obviously there's nothing there that
          > will
          > send the user to a thank you page:
          > <input type="submit" name="submit" id="submit" value="Submit" />
          >
          > What am I doing wrong here? Any help is appreciated, thank you.
          >
          > -Crystal
          >


          • 2. Re: Form Processing
            Level 7
            If you're already using PHP - why don't you use PHP to redirect...?

            Without seeing your PHP code - I'm not too sure how you're handling your
            script but you could add a header location to redirect like so:

            header("Location: http://www.foo.com/success.php");
            exit;

            Show us your code, please.

            --
            Shane H
            shane@NOSPAMavenuedesigners.com
            http://www.avenuedesigners.com


            "Jackeltree" <webforumsuser@macromedia.com> wrote in message
            news:e3o88u$i4p$1@forums.macromedia.com...
            >I have created a php form and all is good (it looks good and the filled out
            > form info is sent to my email address) except when I put code on the
            > submit
            > button to have it link to another page saying "thank you for submitting
            > your
            > question, etc" (I've tried creating that thank you page with both html and
            > php
            > extensions) the button sends the user to the thank you page, but the info
            > isn't
            > sent to my email.
            >
            > This is the code I used for the submit button to get it to link to the
            > thank
            > you page (which is named test2.php). This code brings me to the thank you
            > page
            > like it's supposed to, but fails to send the info to my email:
            > <input type="submit" name="submit" id="submit" value="Submit"
            > onclick="MM_goToURL('parent','test2.php');return
            > document.MM_returnValue"/>
            >
            > This is the code I used on the submit button that worked as far as sending
            > the
            > form information to my email, but obviously there's nothing there that
            > will
            > send the user to a thank you page:
            > <input type="submit" name="submit" id="submit" value="Submit" />
            >
            > What am I doing wrong here? Any help is appreciated, thank you.
            >
            > -Crystal
            >


            • 3. Re: Form Processing
              Level 7

              >
              > What am I doing wrong here? Any help is appreciated, thank you.
              >

              the redirection would take place in the php scripting, after the form data
              is sent to the email.

              details on the scripting you are using?

              • 4. Re: Form Processing
                bregent Most Valuable Participant
                Why not just have the same page that processes the form display the message?
                • 5. Re: Form Processing
                  Jackeltree Level 1
                  That might not be a bad idea...except this is my first experience with php and I don't know how! (The code I have collected is just that: collected code from different turtorials). Can you give me a clue as to how to accomplish what you reccomended? Thanks!

                  -Crystal
                  • 6. Re: Form Processing
                    Level 7
                    Please post your code for further assistance...

                    We should turn that into a forum rule, as no one new here understands we're
                    not mind-readers here...

                    --
                    Shane H
                    shane@NOSPAMavenuedesigners.com
                    http://www.avenuedesigners.com


                    "Jackeltree" <webforumsuser@macromedia.com> wrote in message
                    news:e3o9q0$kco$1@forums.macromedia.com...
                    > That might not be a bad idea...except this is my first experience with php
                    > and
                    > I don't know how! (The code I have collected is just that: collected
                    > code
                    > from different turtorials). Can you give me a clue as to how to
                    > accomplish
                    > what you reccomended? Thanks!
                    >
                    > -Crystal
                    >


                    • 7. Re: Form Processing
                      Jackeltree Level 1
                      This is my form processing script:

                      <?php

                      $name = $_POST['name'];
                      $address = $_POST['address'];
                      $email = $_POST['email'];
                      $phone = $_POST['phone'];
                      $comments = $_POST['comments'];

                      $recipient = "chanehan@ccfne.com";
                      $subject = "personal website submission form";

                      $message = "Name: $name \n";
                      $message .= "Address: $address \n";
                      $message .= "E-mail: $email \n";
                      $message .= "Phone: $phone \n";
                      $message .= "Yes: $yes \n";
                      $message .= "No: $no \n";
                      $message .= "Comments: $comments \n\n";

                      $headers = "From: My Form \n";
                      $headers .= "Reply-To: $email";

                      mail($recipient,$subject,$message,$headers);
                      ?>