The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 7 of 7

Thread: PHP: Simple Email Form

  1. #1

    PHP: Simple Email Form

    Hi, I have been trying to make a more difficult email that I still cannot get to work correctly I am now trying to make a more simple form but I still am not doing something right. Will someone please point out to me what I am doing wrong? or what needs to be chanegd?? Below is my html and php. PROBLEM: when you hit submit nothing happens it just clears my form completetly and does not email anything.

    Thank you!!!!

    HTML Code:
    <form method="POST" action="mailer.php"> 
              <label>First Name:
              <input type="text" name="first" id="first" />
              <p><label>Last Name: 
                <input type="text" name="last" id="last" />
                <input type="radio" name="radio" id="2007" value="2007" />
                <input type="radio" name="radio" id="2008" value="2008" />
                <input type="radio" name="radio" id="2009" value="2009" />
                      <label>Preferred E-mail: 
                      <input type="text" name="email" id="email" />
                      <input type="text" name="address" id="address" />
                      <label><br />
                      <br />
                      <input type="text" name="city" id="city" />
                      <label>                  State:
                      <input type="text" name="state" id="state" />
                      <input type="text" name="zip" id="zip" />
                      <label>Current Residency or Internship Program & Speciality:
                      <input type="text" name="residency" id="residency" />
                      <input name="comments" type="text" id="comments" value="" size="45" />
                      <label>Any News; new residency, publications, awards, honors, weddings, engagements, births
                      <textarea name="news" id="news" cols="45" rows="5"></textarea>
                <input type="submit" name="submit" id="submit" value="Submit" />
                <input type="reset" name="reset" id="reset" value="Reset" />
    PHP Code:
    if(isset($_POST['submit'])) { 
    $to ""
    $subject "Alumni Update"
    $firstname_field $_POST['first']; 
    $lastname_field $_POST['last'];
    $option $_POST['radio'];
    $email_field $_POST['email']; 
    $address_field $_POST['address']; 
    $city_field $_POST['city']; 
    $state_field $_POST['state']; 
    $zip_field $_POST['zip']; 
    $residency_field $_POST['residency'];
    $comments $_POST['comments'];
    $news $_POST['news'
    $body "From: $firstname_field\n $lastname_field\n Option: $option\n E-Mail: $email_field\n $check_msg  Address: $address_field\n City: $city_field\n state: $state_field\n Zip: $zip_field\n Residency:\n $residency_field\n Comments:\n $comments\n News:\n $news\n" 
    "Thank you! Your information has been submitted to $to!"
    } else { 

    Last edited by rubberduckie; September 22nd, 2009 at 10:16 AM.

  2. #2
    PHP Code:
    $news $_POST['news'
    should be:

    PHP Code:
    $news $_POST['news']; 
    add the semi colon at the end of the line.

    Your web server must not be configured to display PHP errors, which is why the page remained blank.

  3. #3
    And is that email address real? You should probably edit it out of your post unless you want loads of spam sent to it.

  4. #4
    Thank you very much for your help!!! and pointing out the email!!!! It works now!! Thanks!!

  5. #5
    No problem, you're welcome.

  6. #6
    I just have one more (probably simple) question.....after it submits the form it goes to a plain page that says "Thank you! Your information has been submitted to $to!" after this shows up is there an easy way to redirect it to another page? or have it direct to a page that has the message but using our website template?

  7. #7
    Ignore last message I have figured it out!! Thanks for your help!!!

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

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012