Very Simple Form

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Nica423
    Sergeant

    • Nov 2007
    • 37

    Very Simple Form

    I have honestly read the tutorials at least three times each for forms. Building it is quite easy. But processing it to mail to your email is a different story.

    I am confused about the property page of the form. Where it asks for Name and Value: What exactly goes there?
    I have the form on my Contacs page and I uploaded a page: Contacts.php to the public_html folder.

    The form properties I have listed are; Acton: Contacts.php - Method: Post - Encoding: Field Empty (as instructed by tutorial.)

    But clicking submit just takes me to a "Page Not Found" message.

    Is there somewhere else the script is to be embedded?
    I've included the script I am using. I simply copied it from one of the tutorials and edited it for my site. It only has three values: Name, email and Comments.

    It's the last element I need for this very basic site.
    Appreciate any help.

    apublicsecret.com (first site)
    mhknuckles@apublicsecret.com

    <HTML>
    <HEAD>
    <TITLE>Guests and Comments</TITLE>
    </HEAD>
    <BODY>
    <H1>Thank you, yah.</H1>

    <?PHP
    $name = $HTTP_POST_VARS['name'];
    $email = $HTTP_POST_VARS['email'];
    $comments = $HTTP_POST_VARS['comments'];
    $mailto = "mhknuckles@apublicsecret.com";
    $mailsubj = "email";
    $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>
    </HTML>
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: Very Simple Form

    Ok, you have made some confusion there:

    1. You have added two hidden fields in your form, named Name, email, Comments. This way the actuall values that the user types, might be overwrite.
    delete these three hidden fields from your form.

    2. The php script that you have used in your contacts.php page, is also wrong. Use the following:

    <?PHP
    $mailto = "youremail@yourdomain.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);
    ?>

    3. Set the encoding type to "multipart / form data"

    4. Name your email field "email" lowercase "e" and not "Email" as you have it.

    5. How did you actually save your thank you page ? I have not been able to find anything on your site. Please note that the php script goes into your thank you page code, not in the form page.

    If you have followed the tutorial, you can NOT have both pages named "Contact" as you are saying here. because BV would overwrite the form page with the thank you page or viceversa.

    Open your Thankyou page in BV. Change the php script that you have in there with the one i gave you. Of course, you need to change the parts in blue with your own email address, subject etc. Set its extension to be php when published, and and save it as "action". Publish it. Now open your form page. Change the encoding type to be multipart/form data and the action to be "action.php"

    Please note that URLs are case sensitive, so if you mistake a "A" for a "a" or viceversa, it will not work.

    Save the form page and publish it.
    Last, REFRESH your browser before testing.
    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

    Working...
    X