message: email sending ready
This commit is contained in:
41
contact.php
41
contact.php
@ -1,42 +1,4 @@
|
||||
<?php include('header.php') ?>
|
||||
<!-- Bootstrap CSS (Include if not already added) -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Toast Container (Fixed Position) -->
|
||||
<div class="position-fixed top-0 end-0 p-3" style="z-index: 1050">
|
||||
<?php if (isset($_GET['status'])): ?>
|
||||
<div id="statusToast" class="toast align-items-center text-white bg-<?php echo ($_GET['status'] == 'success' ? 'success' : ($_GET['status'] == 'error' ? 'danger' : 'warning')); ?> border-0 show" role="alert" aria-live="assertive" aria-atomic="true">
|
||||
<div class="d-flex">
|
||||
<div class="toast-body">
|
||||
<?php
|
||||
if ($_GET['status'] == 'success') {
|
||||
echo "✅ Message sent successfully!";
|
||||
} elseif ($_GET['status'] == 'error') {
|
||||
// echo "❌ There was an error sending your message. Please try again.";
|
||||
echo "❌ There was an error: " . htmlspecialchars($_GET['message']);
|
||||
} elseif ($_GET['status'] == 'missing_fields') {
|
||||
echo "⚠️ Please fill in all required fields.";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php $_GET['status'] = null; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!-- Bootstrap JS & Auto Hide Toast Script -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
let statusToast = document.getElementById("statusToast");
|
||||
if (statusToast) {
|
||||
let toast = new bootstrap.Toast(statusToast, { delay: 3000 }); // Auto-hide after 3s
|
||||
toast.show();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--<< Breadcrumb Section Start >>-->
|
||||
<div class="breadcrumb-wrapper bg-cover" style="background-image: url('img/bg-header-banner.jpg');">
|
||||
@ -73,7 +35,7 @@
|
||||
Drop us a Line
|
||||
</h2>
|
||||
</div>
|
||||
<form action="mail.php" id="contact-form" method="POST" class="contact-form-items mt-5 mt-md-0">
|
||||
<form action="mailContact.php" id="contact-form" method="POST" class="contact-form-items mt-5 mt-md-0">
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-clt">
|
||||
@ -81,6 +43,7 @@
|
||||
<input type="text" name="name" id="name" placeholder="Your Name">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="form-clt">
|
||||
<label for="">Email</label>
|
||||
|
Reference in New Issue
Block a user