Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation ~~Php Contact form code~~

    Ok, i have this code. Everything works, so i do not need it changed. I need to add a part where i can receive files. The name is datafile. i also need a validater for the email field i have been working on this, but i am completely stuck?! Please help me.

    PHP Code:
    <?php

    ## CONFIG ##

    # LIST EMAIL ADDRESS
    $recipient "huntermitchell386@gmail.com";

    # SUBJECT (Contact Form/Remove)
    $subject "Contact Form";

    # RESULT PAGE
    $location "thank_you.html";

    ## FORM VALUES ##

    # SENDER
    $email $_REQUEST['email'] ;

    # MAIL BODY
    $body .= "First Name: ".$_REQUEST['first_name']." \n";

    $body .= "Last Name: ".$_REQUEST['last_name']." \n";

    $body .= "Email: ".$_REQUEST['email']." \n";

    $body .= "Questions: ".$_REQUEST['comments']." \n";
    # add more fields here if required

    ## SEND MESSGAE ##

    mail$recipient$subject$body"From: $email) or die ("Mail could not be sent.");

    ## SHOW RESULT PAGE ##

    header"Location: $location);
    ?>

  2. #2
    Supreme Master coder!
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    10,033
    Thanks
    10
    Thanked 1,153 Times in 1,144 Posts
    Way to difficult to explain using this forum ... so look at these:
    https://www.google.com/search?q=php+...ile+attachment


 

Tags for this Thread

Posting Permissions

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