Need Help With Contact Form !

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • LSS>CN
    Private First Class

    • Jun 2007
    • 8

    Need Help With Contact Form !

    <?PHP
    $mailto ="exampleemail@example.com";
    $email = $HTTP_POST_VARS[email];
    if ($email == "") {
    $email = $mailto;
    }
    $mailsubj = "Type your mail subject here";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values submitted from web site form :\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    if ($key!="submit")
    {
    $mailbody .= "$key : $val\n";
    }
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    ?>
    Can anyone tell me how to use this script properly to combine my contact page and my thank you together
    Do i use the above script in my thank you page properties or on my contact page ive looked at the tutorials over and over but i just am not geting it i did this with my script
    <?PHP
    $mailto = "pdar332010******.ca";
    $email = "contact";
    if ($email == "") {
    $email = $mailto;
    }
    $mailsubj = "Youve Had A Visitor LSS.CN";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "contactlsscn :\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    if ($key!="submit")
    {
    $mailbody .= "$key : $val\n";
    }
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    Is this right or am i way off well those who can help thanx in advance
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: Need Help With Contact Form !

    The instructions clearly say that you should ONLY change the parts in BLUE. You have also changed the third line and it is WRONG.
    Then, you have also missed the closing tag: ?> at the end of the script.

    The script must be pasted in the Inside Body (or Between head, or Start of page, it is not important) of your THANKYOU page. The thank you page MUST be published as php. And, the action of the form, must be the same as as the thankyou page name.
    So, if your thank you page is saved as "thankyou", and this means that it is published as "thankyou.php", the action of the form MUST be "thankyou.php".
    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

    • LSS>CN
      Private First Class

      • Jun 2007
      • 8

      #3
      Re: Need Help With Contact Form !

      Thanks for your reply i expected more from others but thank you again unfortunately it didnt work i did the steps you said but when i hit the submit buton it goes to a blank internet page is there any
      my page is http://www.lifestylesolutions.com.cn/contactlsscn

      any other help i would aprecciate thanks again

      Comment

      • LSS>CN
        Private First Class

        • Jun 2007
        • 8

        #4
        Didnt Work Not Submitting Still

        Thanks for your reply i expected more from others but thank you again unfortunately it didnt work i did the steps you said but when i hit the submit buton it goes to a blank internet page is there any
        my page is http://www.lifestylesolutions.com.cn/contactlsscn

        any other help i would aprecciate thanks again

        Comment

        • Andy128
          Major General

          • Dec 2005
          • 2317

          #5
          Re: Didnt Work Not Submitting Still

          First- in looking at your source code for your form, all the fields are named
          Editbox1, Editbox2, Editbox3 etc........... which is fine except that no field is named "email". Therefore, it does not pluck an email address from which to work with the code provided and thus hangs. So- please name your text box that houses the e-mail address of the sender to - email

          Second- as Naval has stated in the other post, only make changes to the lines in Blue.

          So- make the necessary changes and try again. IF that does not work- please copy exactly the php code you are using and post in this thread. No need to open a new thread.

          Andy
          PHP- is a blast!

          Comment

          • LSS>CN
            Private First Class

            • Jun 2007
            • 8

            #6
            Re: Need Help With Contact Form !

            ive changed all the values in the contact form as you said and now it looks as though it will work however when i hit submit it says page cannot display my theres no link between my contact page and my thank you page http://www.lifestylesolutions.com.cn/contactlsscn.php


            <?PHP
            $mailto = "pdar332010******.ca";
            $email = $HTTP_POST_VARS[email];
            if ($email == "") {
            $email = $mailto;
            }
            $mailsubj = "Youve had a visitor to lsscn";
            $mailhead = "From: $email\n";
            reset ($HTTP_POST_VARS);
            $mailbody = "contactlsscn" :\n";
            while (list ($key, $val) = each ($HTTP_POST_VARS))
            {
            if ($key!="submit")
            {
            $mailbody .= "$key : $val\n";
            }
            }
            mail($mailto, $mailsubj, $mailbody, $mailhead);
            ?>

            Comment

            • Andy128
              Major General

              • Dec 2005
              • 2317

              #7
              Re: Need Help With Contact Form !

              The form action is "thankyou" it should have a .php extension.
              example: thankyou.php

              Give that a try and it should work.

              Andy
              PHP- is a blast!

              Comment

              • LSS>CN
                Private First Class

                • Jun 2007
                • 8

                #8
                Re: Need Help With Contact Form !

                i have added the php extension it still does not work should my thank you the example in the change the values in the blue but in the text area of that example it says email and email subject what should go in the third line ex.<?PHP
                $mailto ="exampleemail@example.com";*
                $email = $HTTP_POST_VARS[email];
                if ($email == "") {
                $email = $mailto;
                }
                $mailsubj = "Type your mail subject here";*
                $mailhead = "From: $email\n";
                reset ($HTTP_POST_VARS);
                $mailbody = "Values submitted from web site form :\n";What goes here ?
                while (list ($key, $val) = each ($HTTP_POST_VARS))
                {
                if ($key!="submit")
                {
                $mailbody .= "$key : $val\n";
                }
                }
                mail($mailto, $mailsubj, $mailbody, $mailhead);
                ?>

                is this what should be in my thank you page and is there any code that applys to mycontact page for some rason my contact submiision goes to cannot be displayed ie page at the top address bar it is
                http://www.lifestylesolutions.com.cn/thankyou.php but its like it doesnt exhist thanks to all in advance willing to help out this rookie

                Comment

                • Andy128
                  Major General

                  • Dec 2005
                  • 2317

                  #9
                  Re: Need Help With Contact Form !

                  Do not change the third line. The error is that the thankyou.php page is not on the server. Have you published the thankyou.php? Open the thankyou page in the web builder and make sure you have:

                  Checked the php extension
                  Check the spelling that you named the page- it should be thankyou not- Thankyou or thank_you or Thank You etc.......
                  Make sure to publish

                  Then try again.

                  Andy
                  PHP- is a blast!

                  Comment

                  • LSS>CN
                    Private First Class

                    • Jun 2007
                    • 8

                    #10
                    Re: Need Help With Contact Form !

                    Andy yeah thank you sir thats what it was a simple case of lower upper case lol thx man your a life saver !

                    Comment

                    • Andy128
                      Major General

                      • Dec 2005
                      • 2317

                      #11
                      Re: Need Help With Contact Form !

                      Your welcome. Have a great week.

                      Andy
                      PHP- is a blast!

                      Comment

                      Working...
                      X