Conan O'Brien
New member
I added a php basic e-mail form on my website, and it worked a few times when I tested it... but now it doesn't seem to be working at all when I test it. When it did work, the e-mails were very slow coming to me. Why is that?
My host claims they support php.
Any ideas why this isn't working now?
10 pts. for best answer.
-----------
Here's the code I used for the form:
<form method="POST" action="orderform.php">
Name
<br>
<input type="text" name="name" size="19"><br>
<p>
E-Mail
<br>
<input type="text" name="email" size="19"><br>
<p>
Name of Item
<br>
<input type="text" name="itemname" size="19"><br></textarea>
<p>
<input type="submit" value="Submit" name="submit">
</form>
And here's the file 'orderform.php':
<?php
if(isset($_POST['submit'])) {
$to = "(MY E-MAIL WAS HERE)";
$subject = "Order";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$itemname = $_POST['itemname'];
$body = "From: $name_field\n E-Mail: $email_field\n Item name:\n $itemname";
echo "Thank you for your order! You will be e-mailed your bill soon.";
mail($to, $subject, $body);
}
?>
NOTE: Recently I changed the php form so that the 'Submit' value is actually now 'submit,' so both cases match in the form and the php script. I was told it's case sensitive. However, that didn't seem to make a difference. I tried contacting the host, but they never answered. Can someone help me out, please?
Thank you all!!
My host claims they support php.
Any ideas why this isn't working now?
10 pts. for best answer.
-----------
Here's the code I used for the form:
<form method="POST" action="orderform.php">
Name
<br>
<input type="text" name="name" size="19"><br>
<p>
<br>
<input type="text" name="email" size="19"><br>
<p>
Name of Item
<br>
<input type="text" name="itemname" size="19"><br></textarea>
<p>
<input type="submit" value="Submit" name="submit">
</form>
And here's the file 'orderform.php':
<?php
if(isset($_POST['submit'])) {
$to = "(MY E-MAIL WAS HERE)";
$subject = "Order";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$itemname = $_POST['itemname'];
$body = "From: $name_field\n E-Mail: $email_field\n Item name:\n $itemname";
echo "Thank you for your order! You will be e-mailed your bill soon.";
mail($to, $subject, $body);
}
?>
NOTE: Recently I changed the php form so that the 'Submit' value is actually now 'submit,' so both cases match in the form and the php script. I was told it's case sensitive. However, that didn't seem to make a difference. I tried contacting the host, but they never answered. Can someone help me out, please?
Thank you all!!