<?php include('include/connect.php');?>


<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>


<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

<script>
// Form 1 handler
jQuery(document).ready(function ($) {
  $("#contact1").on("submit", function (e) {
    e.preventDefault();
    var $form = $(this);
    var formData = $form.serialize();

    $form.find("#pageloader").show();

    $.post("check.php", formData, function (response) {
      $form.find("#result").html(response);
      $form.find("#pageloader").hide();
    }).fail(function () {
      $form.find("#result").html("Submission failed.");
      $form.find("#pageloader").hide();
    });
  });
});
</script>

<script>
// Form 2 handler
jQuery(document).ready(function ($) {
  $("#contact2").on("submit", function (e) {
    e.preventDefault();
    var $form = $(this);
    var formData = $form.serialize();

    $form.find("#pageloader").show();

    $.post("check.php", formData, function (response) {
      $form.find("#result").html(response);
      $form.find("#pageloader").hide();
    }).fail(function () {
      $form.find("#result").html("Submission failed.");
      $form.find("#pageloader").hide();
    });
  });
});
</script>
