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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    PHP Mailing a Form

    Please forgive me, I new to PHP, however I have a question. I created a webpage that has some html and java script validation to make sure the user does not forget to enter some data. However afterward, I would like to e-mail the form to a specific e-mail account, could someone be able to edit the code to implement the required function?
    If anyone could implement this into my page: http://www.thesitewizard.com/archive/feedbackphp.shtml

    http://studentweb.cencol.ca/nsingh76...signment4.html

    Plenty of thanks in advanced.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Change this:

    <form action="MAILTO:whatisthematrix01@hotmail.com?subject=Survey Results" name="frmCustomer" method="post">

    To this:

    <form action="cont.php" name="frmCustomer" method="post">


    Then copy/paste this script as "cont.php" and upload it to the same directory.
    PHP Code:
    <?php 

    // This is a super basic mail form without any 
    // validation, captcha, or checking of any kind. 

    // Get variables from your form ... 
    $firstname $_POST['Fname']; 
    $lastname $_POST['Lname']; 
    $usercity $_POST['UseCity']; 
    $usercountry $_POST['UserCountry']; 
    $useremail $_POST['userEmail']; 
    $username $_POST['Username']; 
    $userpassword $_POST['Userpassword']; 
    $radgender $_POST['radGender']; 

    // Who the form gets sent to ... 
    $recipient "whatisthematrix01@hotmail.com"
    $subject "Interstellar Shipping Contact Form"

    // Where to go after the user submits the form ... 
    $redirect "index.html"

    $message 
    ================================ 
    Name:  $firstname $lastname
    User: $username
    Email:  $useremail 
    ----------------------------------------- 
    City: $usercity
    Country: $usercountry
    Password: $userpassword
    RadGender: $radgender
    ================================ 
    "


    $extraheaders "From: $useremail\n\nReply-To: $useremail\n\n"

    if (! 
    mail($recipient$subject$message$extraheaders)) 
      echo 
    "Mail did not send for some reason."

    header("Location: ".$redirect); 

    ?>

  • Users who have thanked mlseim for this post:

    Nexusfactor (12-07-2010)

  • #3
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Smile

    I DON'T KNOW HOW TO THANK YOU!!!!!
    MANY THANKS SERIOUSLY




    I THANK YOU AGAIN AND AGAIN AND AGAIN in C#

    //infinite loop
    while (true)
    {

    Console.WriteLine ("Thank You");

    }


  •  

    Posting Permissions

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