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 = "[EMAIL PROTECTED], $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....
    }
}
?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to