Help with 2 separate PHP forms on the same page

[code]Aloha, friends! I have a contact form page with 2 separate contact forms on it, and it is not displaying or acting as intended. The page is live at http://fairmontolympiccatering.com/contact-fairmont-olympic-seattle.php. The problems are:

[ol][li]The Thank you message does not display when a form is submitted
The form is not being returned to my email address
In the past when the form was being returned to my email address, the content was blank (input not fcaptured/delivered)[/li]
[li][/li][/ol]

I am desperate to get this fixed, as my client has a big event coming up FAST. So, I am hoping a supremely kind PHP expert can help me fix what’s wrong. Here’s the code:

<?php /*echo '
';
print_r($HTTP_POST_VARS);
echo '
';*/ $err = 0; if ($HTTP_POST_VARS['Submit']) { $email = $HTTP_POST_VARS['Email']; $name = $HTTP_POST_VARS['Name']; $company = $HTTP_POST_VARS['Company']; $mailingaddress = $HTTP_POST_VARS['Address']; $mailingcsz = $HTTP_POST_VARS['CSZ']; $phone = $HTTP_POST_VARS['Phone']; $comments = $HTTP_POST_VARS['Comments']; $drinks = $HTTP_POST_VARS['Drinks']; $altphone = $HTTP_POST_VARS['Alternate_Phone_']; $numberofguests = $HTTP_POST_VARS['Number_of_Guests']; $dateofevent = $HTTP_POST_VARS ['Date_of_Event']; $durationofevent = $HTTP_POST_VARS ['Duration_of_Event']; $eventtype = $HTTP_POST_VARS['Event_Type']; $cateringtype = $HTTP_POST_VARS['Catering_Type']; $site = $HTTP_POST_VARS['Site']; $source = $HTTP_POST_VARS['Source']; $commentquestion = $HTTP_POST_VARS['Question']; $tour = $HTTP_POST_VARS['Tour']; $quote = $HTTP_POST_VARS['Quote']; if ( strlen($name)<3 || strlen($numberofguests)<1 || strlen($email)<5) { $err=1; } } elseif ($HTTP_POST_VARS['Submit2']) { $name = $HTTP_POST_VARS['Name2']; $company = $HTTP_POST_VARS['Company2']; $email = $HTTP_POST_VARS['Email2']; $question = $HTTP_POST_VARS['Question']; if ( strlen($name)<3 || strlen($question)<1 || strlen($email)<5) { $err=1; } } //$mailto = "[email protected], [email protected]"; $mailto = '[email protected]'; $mailsubj = "Fairmont Olympic Catering Quote Request"; $mailhead = "From: $email\n"; if (!$err && $HTTP_POST_VARS) { reset ($HTTP_POST_VARS); $mailbody = "A visitor has submitted a quote request, comment, or question.:\n"; while (list ($key, $val) = each ($HTTP_POST_VARS)) { if(!empty($val) && $key !='Submit' && $key != 'Submit2') { if ($key == 'Name2') { $key = 'Name'; } if ($key == 'Company2') { $key = 'Company'; } if ($key == 'Email2') { $key = 'Email'; } $mailbody .= "$key : $val\n"; } } /// if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); } //print_r($mailbody); mail($mailto, $mailsubj, $mailbody, $mailhead); $email = ''; $name = ''; $phone = ''; $comments = ''; $drinks = ''; $altphone = ''; $numberofguests = ''; $dateofevent = ''; $durationofevent = ''; $company = ''; $eventtype = ''; $cateringtype = ''; $site = ''; $source = ''; $commmentquestion = ''; $tour = ''; $quote = ''; } ?>[/code]

and

[code]





Request a quote or a tour of our spaces
Fill out the form below to tell us a little bit about your event, so we can plan a tour for you or put together a sample quote. You can also call us anytime!

    <tr valign="middle">
      <td colspan="2" bgcolor="#FFFFFF" class="bodycopy"><p align="center" class="style9 style11">
          <?php
if (!$err && $HTTP_POST_VARS) {

?>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Thank you so much for your tour or quote request.

We will respond to you as soon as we can, and look forward to serving you!

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -




<?php
}
else {
?>



<?php
}
?>













































































Please fill out required () fields. If you have already tried to submit the form, please check required fields and resubmit.

I would like a…

Personal tour of the event spaces
 
Premliminary quote
 
Name
Company
Street address or PO Box
City, state, zip
E-mail
Phone
  or

(Alternate)
Number of guests
Date of event
(Or general time of year)
Duration
Afternoon? Evening? All day?

Event

Wedding? Anniversary? Corporate?

Gala?

<?php echo $eventtype; ?>
Type

Buffet? Sit-down? Hors d’oeuvres and drinks?
<?php echo $cateringtype; ?>
Preferred event room
<?php echo $site; ?>
Comments about food and or theme or any notes you would like to share about what you are envisioning or require <?php echo $comments; ?>
Drinks or bar service <?php echo $drinks; ?>
How did you become interested in the Fairmont Olympic Hotel for your event? <?php echo $source ?>
 




 


Send us a question or comment




        <tr valign="middle">
          <td colspan="2" bgcolor="#FFFFFF" class="bodycopy"><p align="center" class="style9 style11">
              <?php
if (!$err && $HTTP_POST_VARS) {

?>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Thank you so much! You have successfully submitted your question or comment. We will respond to you as soon as we can and look forward to serving you!

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -




<?php
}
else {
?>



<?php
}
?>







        <tr valign="middle">
          <td class="bodytext"><strong>E-mail</strong> <span class="style16">*</span></td>
          <td class="bodytext"><input name="Email2" type="text" id="Email2" size="39" maxlength="80" value="<?php echo $email; ?>" /></td>
        </tr>

        <tr valign="bottom">
          <td valign="top" class="bodytext"><strong>Comment or question</strong> <span class="style16">*</span></td>
          <td class="bodytext"><textarea name="Question" cols="40" rows="20" class="style8" id="Question"><?php echo $commentquestion; ?></textarea></td>
        </tr>

        <tr valign="bottom">
          <td valign="middle" class="bodycopy">&nbsp;</td>
          <td class="bodycopy"><div align="right"><br />
                  <input type="submit" name="Submit2" value="Submit" />
          </div></td>
        </tr>
    </table></td>
  </tr>
</table>    <p align="left" class="headline" style="margin-bottom: -3px;">&nbsp;</p></td>

Please fill out required () fields. If you have already tried to submit the form, please check required fields and resubmit.

Name
Company
[/code]

Oops included my message in the first block of code :-[ Hope it’s not a problem, can’t find the edit-post function…

Well first of all, whats the point of this bit?
[php]$email = ‘’;
$name = ‘’;
$phone = ‘’;
$comments = ‘’;
$drinks = ‘’;
$altphone = ‘’;
$numberofguests = ‘’;
$dateofevent = ‘’;
$durationofevent = ‘’;
$company = ‘’;
$eventtype = ‘’;
$cateringtype = ‘’;
$site = ‘’;
$source = ‘’;
$commmentquestion = ‘’;
$tour = ‘’;
$quote = ‘’;[/php]

All it is doing is resetting all inputs to empty?

Sponsor our Newsletter | Privacy Policy | Terms of Service