How to force to a new page after completing form?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • adrianbrookes
    First Sergeant

    • Sep 2006
    • 72

    How to force to a new page after completing form?

    I have a simple "contact us" type of form on a page, and it works fine. Upon users clicking on the "Send Form" button in the form, I would like them to be redirected to a specific page.

    How do I do that?

    Thanks,

    Adrian
    Adrian
    A-B Technology Group
  • Andy128
    Major General

    • Dec 2005
    • 2317

    #2
    Re: How to force to a new page after completing form?

    On the php script- try putting the line in blue as shown below;

    mail($mailto, $mailsubj, $mailbody, $mailhead);
    header("Location: http://www.yourdomain.com/thankyou_page.html");
    ?>

    Simply replace the thankyou_page with what ever page you want them
    to be directed to.

    Andy
    PHP- is a blast!

    Comment

    • adrianbrookes
      First Sergeant

      • Sep 2006
      • 72

      #3
      Re: How to force to a new page after completing form?

      Thats great - thanks; I'll try it tomorrow,

      Adrian
      Adrian
      A-B Technology Group

      Comment

      • adrianbrookes
        First Sergeant

        • Sep 2006
        • 72

        #4
        Re: How to force to a new page after completing form?

        I did try it but got the following error message preceeding the original contact_us page:

        Warning: Cannot modify header information - headers already sent by (output started at /home/tiuxcygp/public_html/mskeducation/contact_us.php:7) in /home/tiuxcygp/public_html/mskeducation/contact_us.php on line 40


        And here's what I did:

        }
        }
        mail($mailto, $mailsubj, $mailbody, $mailhead);
        header("Location: http://www.abtechnologygroup.com/mskeducation/contact_us_thankyou.html");
        ?>

        I also tried taking out the one space between "location:" and http://www
        but the same result.

        Any ideas??
        Adrian
        A-B Technology Group

        Comment

        • navaldesign
          General & Forum Moderator

          • Oct 2005
          • 12080

          #5
          Re: How to force to a new page after completing form?

          This is because you have the php script already in your form page. The page sends the info to itself, the script (when the page is reloaded) sends you the email, but the visitor finds himself in the same page.
          Solution:
          1. Open your contact_us page in BV. Delete the script, from wherever in the page you have placed it. Double click on the form, and change it's action to "contact_us_thankyou.php" Go to page properties, and set the page extension in "html" . Save the page and publish it.
          2. Open the "contact_us_thankyou" page. Click on View, Page HTML. Click on "Inside Body". Paste the script in the lower window, without the line that Andy has suggested. Click ok. Go in page Properties, and set the page extension to be "php". Save and publish
          3. Last step: change the contact form link in your menu bars, in http://www.abtechnologygroup.com/msk...ontact_us.html


          If you want to avoid the changes in your menubars, which also means opening, editing and republishing ALL your pages, you can do the following:

          In step 1, follow the rest of the instruction, but instead of setting the page extension to be "html" leave it as "php". The page will still be published as php, so you will not need to change your menubars, but is is by all means equivalent to a html page because there will be no php code in it.
          Navaldesign
          Logger Lite: Low Cost, Customizable, multifeatured Login script
          Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
          DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
          Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

          Comment

          • adrianbrookes
            First Sergeant

            • Sep 2006
            • 72

            #6
            Re: How to force to a new page after completing form?

            Thanks for both your replies; that last suggestion worked so I'll stick with that one.

            Appreciate the feedback, and everyday I use BV the more I love it!!!

            Adrian
            Adrian
            A-B Technology Group

            Comment

            • keeptrack
              Sergeant First Class

              • Dec 2006
              • 50

              #7
              Re: How to force to a new page after completing form?

              Hello

              I see that adrianbrookes had the same problem as I do now.... for my website www.keeptrackconcierge.com I've tried to follow the steps that you gave. I am actually able to bring up the thank you page, but now I do not receive any emails when the form is sent.

              If possible can you please assist me in this matter

              Nicole
              Regards,

              Nicole Delamore
              website: www.keeptrackconcierge.com

              Comment

              • Andy128
                Major General

                • Dec 2005
                • 2317

                #8
                Re: How to force to a new page after completing form?

                Yes we can help. Please copy and then paste the php code that you used to process the form and here in this thread. That way we can see what is up.

                Cheers,

                Andy
                PHP- is a blast!

                Comment

                • keeptrack
                  Sergeant First Class

                  • Dec 2006
                  • 50

                  #9
                  Re: How to force to a new page after completing form?

                  Hi

                  Thank you for responding to my query.

                  Fortunately I was able to get the problem fixed and now the website, the thank you page and e-mail are working brilliantly.

                  This is my first website I've built and at times it can get frustrating, so it is good to know there are experts to lend a helping hand.
                  Regards,

                  Nicole Delamore
                  website: www.keeptrackconcierge.com

                  Comment

                  Working...
                  X