PhP Contact Form Page

Discussion in 'Programming' started by mgandy, Nov 3, 2009.

  1. #1
    Hi Guys,

    I need some help for some reason my contact form page is returning blank results when submitted.

    Provided below is the the PHP code that I am using and the contact page can be found at http://www.exhibe.com/contact-us.htm.

    Any help would be appreciated

    <?php
    # ATTENTION! - IF YOU COPY THIS CODE, CHANGE THE NEXT LINE!
    $to = "sales@exhibe.com";
    $message = "Contact Name: $Name\nPhone: $phone\nCompany: $company\nFax: $fax\nAddress: $address\nEmail: $Email\nCity: $city\nWeb: $web\nState: $state\nIndustry: $industry\nZip Code: $zip\nExhibit Type: $exhibittype\nCountry: $Country\nShow Date: $showdate\nNumber of Shows: $numbershows\nProject Description: $Comments\n";
    $eLog="/tmp/mailError.log";
    //Get the size of the error log
    //ensure it exists, create it if it doesn't
    $fh= fopen($eLog, "a+");
    fclose($fh);
    $originalsize = filesize($eLog);
    mail ($to, "Website Email", $message);

    /*
    * NOTE: PHP caches file status so we need to clear
    * that cache so we can get the current file size
    */
    clearstatcache();
    $finalsize = filesize($eLog);

    //Check if the error log was just updated
    if ($originalsize != $finalsize) {
    print "<p>There was a problem sending the mail. Please try again later or send the message to<a href=\"$to\">$to</a> using your own mail client progam.</p>";
    } else {
    header("Location: http://www.exhibe.com/contact-us.htm");
    }


    ?>

    Thanks,

    Mike
     
    mgandy, Nov 3, 2009 IP
  2. sunchiqua

    sunchiqua Peon

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    # attention! - if you copy this code, change the next line!
    Code (markup):
    I hope you removed this line ?
     
    sunchiqua, Nov 3, 2009 IP
  3. devxtreme

    devxtreme Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    isn't the contact page form suppose to be in .php format instead of .html??

    Also after you submit the form, to get the values, you need to use $_GET['Name'] or $_POST['Name'] instead of just $Name.

    BTW here are some alternative forms:-
    web-kreation.com/demos/LightForm/
    dustindiaz.com/ajax-contact-form/

    Let me know if you need any help. Can be daunting if you don't know php.
     
    devxtreme, Nov 3, 2009 IP