|
Posted by DG on 10/11/49 11:53
We have a simple comment form on our website that gets sent to us via email
using a PHP script. It was working fine until last week (that's when we
noticed it anyway) when it started asking for login (username, password,
etc.) when the send comment button was clicked. I called tech support where
our website is hosted and they looked in to it, got the login popup to stop
but now it is coming up with "CGI Error. The specified CGI application
misbehaved by not returning a complete set of HTTP headers." They said they
updated to PHP 5.1.4 and it is probably something in our PHP file that may
have to be updated. They also switched to a new mail server within the past
week or so that requires SMTP authentication. Does anyone know if one, or
both, of these could be causing a problem with our PHP script? Any help
will certainly be appreciated, we'd like to get our comment form up and
running again.
This is the PHP we have been using: (The comment form itself is a separate
file, if you need to see it please let me know)
<?
/*
Comment Form
*/
$mailto = 'OUR EMAIL ADDRESS' ;
$subject = "Questions or Comments Submitted via Website" ;
$formurl = "FORM URL" ;
$errorurl = "ERROR MSG URL" ;
$thankyouurl = "THANKS MSG URL" ;
$name = $_POST['name'] ;
$city = $_POST['city'] ;
$state = $_POST['state'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email)) {
header( "Location: $errorurl" );
exit ;
}
$name = strtok( $name, "\r\n" );
$email = strtok( $email, "\r\n" );
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper =
"This message was sent from:\n" .
"$http_referrer\n" .
"Name: $name\n" .
"City: $city\n" .
"State: $state\n" .
"Email: $email\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments .
"\n\n------------------------------------------------------------\n" ;
mail($mailto, $subject, $messageproper, "From: \"$name\"
<$email>\r\nReply-To: \"$name\" <$email>\r\nX-Mailer: chfeedback.php
2.04" );
header( "Location: $thankyouurl" );
exit ;
?>
Navigation:
[Reply to this message]
|