Results 1 to 4 of 4

Thread: PHP Contact Form Validation
      
   

  1. #1
    Join Date
    Sep 2007
    Posts
    2

    Exclamation PHP Contact Form Validation

    Hi there!

    I'm developing my website with BlueVoda, and I added a "contact form" with a Thankyou.php page:

    http://www.vodahost.com/DemoDemo/bvt..._basicform.htm

    http://www.vodahost.com/vodatalk/44039-post5.html

    So, my contact form & Thankyou page work perfectly, I receive the feedback from my visitors... the problem (there's always one, huh?) is that I need to "validate" the form, that is to say, to have a little piece of code able to check the three fields (name, email, comments) before sending me an empty email, to prevent what now happens: email account collapsed with empty emails...

    I've tried to validate it through javascript, in the same page of the form, "contact.html", but it doesn't work... as soon as I click to send the form (through Thankyou.php, as action="Thankyou.php" and method="post"), the thankyou page processes an empty email to my account...

    And I know nothing about php scripting, so I should not "touch" any code provided by BlueVoda & Forum Members working as is...

    Can anyone help me, please...? I just need to stop empty emails collapsing my account with the same structure I have now (no more pages):

    + Contact.html (contains the basic form and sends it to process it through Thankyou.php)
    + Thankyou.php (contains the php code provided below and a Thank You message)

    <?PHP
    $email = $HTTP_POST_VARS[email];
    $mailto = "myemail@mydomain.com";
    $mailsubj = "Envío de Formulario de Contacto";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Valores enviados desde el formulario de contacto :\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    if ($key!="submit")
    {
    $mailbody .= "$key : $val\n";
    }
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    ?>

    Thank you in advance and, please, forgive my english, I'm not an english native speaker!

  2. #2
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: PHP Contact Form Validation

    There are two ways to validate fields:

    1. Through javascript. However, you don't need to embedd external Javascripts. In your BV form, double click the fields, and select Validate. It will give you some options for validation, among them Required field, Custom error message , email address, etc.

    2. Using ABVFP. It will perform php validation which cannot be overidden by users that have disabled Javascript in their browsers, and also has a lot of other features. Have a look at Advanced BlueVoda Form Processor
    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!


  3. #3
    Join Date
    Sep 2007
    Posts
    2

    Wink Re: PHP Contact Form Validation

    First of all, I apologize for asking questions that could be answered just paying attention to a well done job... I mean the BlueVoda website builder, with its validating forms options...

    Thank you, navaldesign,the first way (javascript in BV) was the (my) solution... The ABVFP is an option too "difficult" to my knowledges...

    Thanks again!!

  4. #4
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: PHP Contact Form Validation

    Not a problem. You have just lost your patience for a moment LOL!!
    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!


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •