Thread: html form

    #1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2008
    Posts
    768
    Rep Power
    41

    html form


    OK, I cannot look at this anymore. Can someone look at this?
    the page is contact.php

    So I have a hidden field that I check for,
    Code:
    <input type="hidden" name="submitted" value="true">
    I validate the form, ending like this
    PHP Code:
    if(!empty($errors)){                    
                            
                        
    //    echo '<p>Please correct the folowing field(s) below:<ul>';
                            //foreach ($errors as $error){
                                
                            //    echo"<li>$error</li>\n";
                                 
    $errors[]="1";
                                 
    $errors="1";
                            }
                            
    else{
    $errors="0";

    Then I have this code in the contact form, which should run if the form is submitted
    PHP Code:
    if(isset($_POST['submitted']))
    {
        include 
    'validate-contact-form.inc';    
        if(
    $errors='0')
            {
            
            
            echo 
    'Your info has been sent. We will contact you with 48 hrs.  Thank you.';
            
                   
    $message="hello Scott, you have received a new message through the contact form request $first_name $last_name $email $subject $message";
             
            
    mail('email@email.com''new contact form message'$message);
            exit;
        }
            else
            { 

    but a form with no errors, that is submitted does not mail the message or echo 'your info has been sent' etc.

    I do not see what is wrong here.

    thanks in advance : )
  2. #2
  3. Forgotten Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,013
    Rep Power
    9616

IMN logo majestic logo threadwatch logo seochat tools logo