Email Forms

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Anonymous
    Members

    • Mar 2005
    • 439

    Email Forms

    Thanks for all previous help - things moving along quite nicely! :D
    Next question!! I've composed a form on a page that I've called Contact Us. The idea being - a visitor fills it in - presses the button and Hey Presto - the completed form arrives in my in-box! I've watched the relevant Tutorial (8 million times!).
    I've published the page and tested it. I can fill the form in, but when I press the submit button - it just gives me the option to send an email. The completed form is not sent - but at least I'm halfway there. How should I configure the form to make it work properly?
    Last edited by Sarah; 06-19-2005, 03:27 PM.
  • Anonymous
    Members

    • Mar 2005
    • 439

    #2
    Sending (client sided) forms from a PC works like this:
    Your browser creates a email message and will use your default email client to send this message (using MAPI).
    To configure your default email client:
    Internet Explorer Menu->Tools->Internet Options->Programs->Email
    Select your email client (prefferable Outlook Express).
    Also make sure it's the default MAPI client:
    In Outlook Express->Menu->Tools->Options->General Tab
    and click This application is the default Mail Handler ->Make Default

    If you like you can read the following internet articles for more details:
    http://webdesign.about.com/cs/forms/a/aamailtobroke.htmor

    or


    But since you're using Vodahost you can alos use a PHP script to create a more reliable solution.

    Comment

    • Anonymous
      Members

      • Mar 2005
      • 439

      #3
      I have created an example script for you that processes your form succesfully using a generic PHP script.

      Instructions:
      Change the form properties (in BlueVoda) to:
      Action: FEEDBACK.PHP
      Method: POST
      EncodingType:
      (remove the text/plain, so the field becomes empty)

      Now create a new file using Notepad and call it: FEEDBACK.PHP
      Enter the following code into the file:

      Code:
      <HTML>
      <HEAD>
      <TITLE>Thank you for your feedback</TITLE>
      </HEAD>
      <BODY>
      <H2>Thank you for your feedback!</H2>
      <?PHP
      $email = $HTTP_POST_VARS[email];
      $mailto = "feedback@yourdomain.com";
      $mailsubj = "Feedback form";
      $mailhead = "From: $email\n";
      reset ($HTTP_POST_VARS);
      $mailbody = "Values submitted from web site form:\n";
      while (list ($key, $val) = each ($HTTP_POST_VARS)) 
      {
      $mailbody .= "$key : $val\n"; 
      }
      mail($mailto, $mailsubj, $mailbody, $mailhead);
      ?>
      </BODY>
      </HEAD>
      Upload this file to your domain.
      Last edited by Pablo; 06-29-2005, 05:54 PM.

      Comment

      • Judy Khoo
        Members

        • May 2005
        • 30

        #4
        Submitting form for email

        Hi

        I have used the example script you gave and I have no problem in getting the mail sent out.

        However, when I open the mail from my mail box, I find the following message was sent:

        Values submitted from web site form:
        Name : test
        Email : judyksp********.com
        S1 : test
        Submit : Send


        and the sender is unknown.

        how can i correct this to reflect the right information from my email form?

        I have three fields in the form I created:

        a. Name - where the user is to type his/her name
        b. email - where the user is to type his/her email address
        c. Message - a free text area for the person to type the message

        I am extremely new to web hosting and scripting. I have no knowledge of PHP either. Hope you can assist.
        Judy Khoo
        Work at home? Try http://www.increasemyearnings.com

        Relax and have fun at http://www.vikingbar.net

        Comment

        • Pablo
          Moderator

          • May 2005
          • 507

          #5
          Since the email is send from the server where your domain is running on you can't see the actually sender (since it's the vodahost server that sent you the message when the form is submitted). But your visitors should enter there email address in one of the fields you create with BlueVoda.

          Looking at the data you received in the message, it looks like you already have a field for the email address?

          Pablo
          Forum Moderator
          BlueVoda Spe******t

          Comment

          • Judy Khoo
            Members

            • May 2005
            • 30

            #6
            So what I saw in the contents of the mail is what the visitor would have typed, right? And if I wish to reply to them, it would be to the email that was displayed in the message, right?

            Thanks.
            Judy Khoo
            Work at home? Try http://www.increasemyearnings.com

            Relax and have fun at http://www.vikingbar.net

            Comment

            • Pablo
              Moderator

              • May 2005
              • 507

              #7
              Absolutely correct.
              Forum Moderator
              BlueVoda Spe******t

              Comment

              • Judy Khoo
                Members

                • May 2005
                • 30

                #8
                Thank you very much for your assistance.

                I have one more request and hope you can help.

                Currently, your scripts returns a message on successful submission on a new page. How do I get to change it to show on the same page but perhaps at the bottom of the screen? Or if I have to do it on a new page, how do I get to format the page to look better?
                Judy Khoo
                Work at home? Try http://www.increasemyearnings.com

                Relax and have fun at http://www.vikingbar.net

                Comment

                • Pablo
                  Moderator

                  • May 2005
                  • 507

                  #9
                  There is currently no easy way to do this, but here something that might work for you:

                  1. Create a new page with BlueVoda and save is as 'feedback.bvp'.
                  2. Select View->Page HTML from the menu
                  3. Select the Inside Body tag and enter this code:
                  Code:
                  <?PHP 
                  $email = $HTTP_POST_VARS[email]; 
                  $mailto = "feedback@yourdomain.com"; 
                  $mailsubj = "Feedback form"; 
                  $mailhead = "From: $email\n"; 
                  reset ($HTTP_POST_VARS); 
                  $mailbody = "Values submitted from web site form:\n"; 
                  while (list ($key, $val) = each ($HTTP_POST_VARS)) 
                  { 
                  $mailbody .= "$key : $val\n"; 
                  } 
                  mail($mailto, $mailsubj, $mailbody, $mailhead); 
                  ?>
                  4. Do the usual page formatting.
                  5. Publish the page to your VodaHost account.
                  6. Login to your cPanel and select File Manager to rename feedback.html to feedback.php
                  Of course you can also use your favorite FTP client to rename the file.

                  Pablo
                  Last edited by Pablo; 09-10-2005, 12:47 PM.
                  Forum Moderator
                  BlueVoda Spe******t

                  Comment

                  • Judy Khoo
                    Members

                    • May 2005
                    • 30

                    #10
                    Thanks. I will try it. Meanwhile, just a question - do I have to remove the earlier feedback.php that was created and replace with this new php?
                    Judy Khoo
                    Work at home? Try http://www.increasemyearnings.com

                    Relax and have fun at http://www.vikingbar.net

                    Comment

                    • VodaHost
                      General & Forum Administrator

                      • Mar 2005
                      • 12356

                      #11
                      yes please

                      VodaHost

                      Your Website People!
                      1-302-283-3777 North America / International
                      02036089024 / United Kingdom
                      291916438 / Australia

                      ------------------------

                      Top 3 Best Sellers

                      Web Hosting - Unlimited disk space & bandwidth.

                      Reseller Hosting - Start your own web hosting business.

                      Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


                      Comment

                      • Judy Khoo
                        Members

                        • May 2005
                        • 30

                        #12
                        Thank you for the script. It works.
                        Judy Khoo
                        Work at home? Try http://www.increasemyearnings.com

                        Relax and have fun at http://www.vikingbar.net

                        Comment

                        • busymomz
                          Members

                          • Jun 2005
                          • 2

                          #13
                          Question about this topic

                          I'm a bit new to all this, and I happened to stumble across your discussion which was just what I was looking for, and I needed some help.

                          I have tinkered with the code here and there getting farther and farther along, until I have hit a barrier. When I press my submit button, I get a message that says "No Input File Specified".

                          Any Idea what to do?

                          Thanks

                          Comment

                          • VodaHost
                            General & Forum Administrator

                            • Mar 2005
                            • 12356

                            #14
                            have you named your php file correctly?

                            VodaHost

                            Your Website People!
                            1-302-283-3777 North America / International
                            02036089024 / United Kingdom
                            291916438 / Australia

                            ------------------------

                            Top 3 Best Sellers

                            Web Hosting - Unlimited disk space & bandwidth.

                            Reseller Hosting - Start your own web hosting business.

                            Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


                            Comment

                            • busymomz
                              Members

                              • Jun 2005
                              • 2

                              #15
                              OK, I figured it all out, and now I'm up and running.
                              However, I would like to create another type of form but am not sure how to do it.
                              I just need to be able to have the user define what email the form is sent to.
                              Is this possible?

                              Comment

                              Working...
                              X