1

Wondering if anyone out there could help me spot the flaw in my form setup? Emails are coming through, but with none of the information entered by the message sender:

Email Body:

Name:

Email:

Existing Customer:

Org Type:

Message:

Here is the HTML:

<form action="email.php" method="POST" name="contact" enctype="text/plain">

            <label for="name">Name: </label><input type="text" name="name" id="name">
            <label for="email">Email: </label><input type="text" name="email" id="email"><br><br>

            <label for="existing">Have you written before?</label>
            <input type="radio" name="existing" value="Yes" id="existingyes">Yes
            <input type="radio" name="existing" value="No" id="existingno">No<br><br>

            <label for="orgtype">How do you classify yourself? </label><select id="orgtype">
                <option>Charity</option>
                <option>Business</option>
                <option>Individual</option>
                <option>Meat Popcicle</option>
                <option>Other</option>
            </select><br><br>

            <label for="essay">Thoughts? Questions? Comments</label><br>
            <textarea name="essay" rows="3" cols="70" id="essay">...</textarea><br><br>

            <input type="submit" value="Yell At Us!"><br>

And here is the PHP:

    <?php
  $name    = stripslashes($_POST['name']);
  $email   = stripslashes($_POST['email']);
  $existing   = stripslashes($_POST['existing']);
  $orgtype = stripslashes($_POST['orgtype']);
  $essay = stripslashes($_POST['essay']);
  $form_message = "Name: $name \nEmail: $email \nExisting Customer: $existing \nOrg Type: $orgtype \nMessage: $essay";
  $success = mail("myemail@email.com", "Online Form Submission", $form_message, "From: $email" );
  if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;URL=index.html\">";

    } else {

echo "Sorry error please try again..."; 

}

?>

Any help would be greatly appreciated!

Tee Dot
  • 13
  • 2

1 Answers1

0

remove the enctype="text/plain" from you're form tag.

<form action="email.php" method="POST" name="contact">

You can read about it here method="post" enctype="text/plain" are not compatible?

Community
  • 1
  • 1
rorypicko
  • 4,194
  • 3
  • 26
  • 43