Form Processing problem....
| From: | Jack Lauman | Date: | Wed, 18 Apr 2001 00:46:32 +0000 |
| Subject: | Form Processing problem.... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-49096@lists.php.net to get a copy of this message | ||
I am calling the following php script from an HTML form with
<form name="comment_form" method="post"
action="php/comment_form.php">
In Internet Exploder 5.0 it processes the form, sends the message and
commits to the database, but does not return to the referring page.
In Netscape 4.77 it displays an error message the document contained
no data even though it processes the form, sends the message and
commits to the database.
I would appreciate any insight on how to resolve this problem.
Thanks,
Jack
<?
$form_date = date("Y-m-d");
$form_time = date("H:i:s");
if (isset ($submit_form)) {
// Define Mail Variables
//
$mailTo = "info@anydomain.com, $form_email";
$mailSubject = "Message Subject";
$mailHeaders = "From: $form_email";
$mailBody = "The following comment was submitted:\n\n";
$mailBody .= "Date: $form_date\n";
$mailBody .= "Time: $form_time\n\n";
$mailBody .= "By: $form_name\n";
$mailBody .= " $form_address1\n";
$mailBody .= " $form_address2\n";
$mailBody .= " $form_city, $state $zip\n";
$mailBody .= " $form_country\n\n";
$mailBody .= "E-mail: $form_email\n";
$mailBody .= "Phone: $form_phone\n\n";
$mailBody .= "$form_comments\n";
mail($mailTo, $mailSubject, $mailBody, $mailHeaders);
// Connect to MySQL and store the collected information in the
database.
//
mysql_connect( "localhost", "uid", "pwd");
$query = "INSERT INTO comments VALUES
('$form_id',
'$form_date',
'$form_time',
'$form_name',
'$form_address1',
'$form_address2',
'$form_city',
'$form_state',
'$form_zip',
'$form_country',
'$form_email',
'$form_phone',
'$form_comments')";
$result = mysql_db_query( "bbleisurepark", $query) OR
die(mysql_error());
if ($result) {
// Add success-error messages here....
}
}
?>