I have this code that works fine on a php 5 machine you can see it work here:
http://www.goodtogonetworks.com/Contact_Us/contact_us.html
but when I try it on a php 4 server it doesn't mail or go to the next page.
The entire code is below. Can anyone tell me how to correct it to work on the other server. The server is working (it sends other simple mail messages) so it is something in this specific code that the php 4 machine doesn't like.
One other difference between the two servers is the php4 one that doesn't work is configured::
sendmail_from me@localhost.com me@localhost.com
Whereas the other is that does work is configured:
sendmail_from no value no value
As always thanks for looking and for any help.
<html>
<head><title>Contact Us</title></head>
<body BGCOLOR="#FFFFCC">
<BR>
<BR>
<img alt=""
src="Contact_Us_NDaisyBanner.gif"
style="width: 600px; height: 58px;">
<h1> Under Construction</h1>
<?php
// Handle POST method.
if ($_POST)
{
$name = $_POST['name'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$headers = 'From: mcsouthmembership.inlandproductivity.com' . "\r\n" .
// Compose simple text message:
$message = "Message from $name ($email)\n\nComments:\n\n$comments";
// Send message to [email]bob@microsoft.com[/email]
mail("me@mydomain.com", "Feedback from Momsclub", $message);
// Thank the generous user
echo "<h1>Thank You For Contacting Us</h1>\n";
}
else
{
?>
<font color="#660000"
face="Comic Sans MS,Tekton,Blueprint,Dom Casual,Dom Casual BT">
<FORM style="border: 0px dotted red; padding: 2px" action="<?= $PHP_SELF ?>" method="post">
<p>Name: <input type="text" name="name" /></p>
<p>Email: <input type="text" name="email" /></p>
<p>Comments:</p>
<p><textarea name="comments"></textarea></p>
<p><input type="submit" value="Send!" /></p>
</form>
<?php
}
?>
</body>
</html>