PHP web form not working properly
I am having a problem with writing some PHP script in an attempt to draw info, entered by users, on a form on my site and email it to myself. The form is on the website page www.highwaytoheavenchurch.com/prayerRequest.php
In lesson 13 of the textbook "Classroom in a Book for Adobe Dreamweaver CS5" it takes you through the PHP script for emailing forms and gives a great example to follow. I adapted this example to fit my needs. Here is the script I have written;
<?php
$to = "edjax1952@yahoo.com";
$subject = "Website Prayer Request";
$message =
"Name: ". $_POST['name'] . "\r\n" .
"Email: " . $_POST['email']. "\r\n" . "\r\n" .
"Prayer Request:" . $_POST['prayerRequest'];
$from = $_POST['email'];
$headers = "From: $from" . "\r\n";
mail($to,$subject,$message,$headers);
?>
The html for the form is:
<form action="email_form.php" method="post" enctype="multipart/form-data" name="websitePrayerRequest" id="websitePrayerRequest">
<p>
</p>
<fieldset>
<legend>Name and Email</legend><p>
<label id="name">Name (not required)
<input name="name" type="text" id="name" size="30" maxlength="30">
</label>
</p>
<p><span id="email">
<label for="email">Email</label>
<input type="text" name="email" id="email">
<span class="textfieldRequiredMsg">An email address is required.</span><span class="textfieldInvalidFormatMsg">Please enter a valid email address.</span></span></p></fieldset>
<p>
</p>
<p>Enter your prayer request here:</p>
<p>
<textarea name="prayerRequest" cols="75" rows="8" id="prayerRequest"></textarea>
</p>
<p>
<label>
<input type="submit" name="Submit" id="submit" value="Submit">
Submit Your Request</label>
</p>
</form>
The result is that the form will email me with the sender being the name of my FTP account of my hosting provider (this is acceptable), and the following info in the body of the email:
Name:
Email:
Prayer Request:
Obviously, it does not draw the information typed into the form text boxes by the user.
Do you have any suggestions for me?
