Server IP : 103.53.40.154 / Your IP : 3.135.184.195 Web Server : Apache System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : ppcad7no ( 715) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0750) : /home2/ppcad7no/comfortaircon.co/../aaliyadecor.com/../thegloriousadventure.com/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php include_once('admin/config.php'); function isAllowedMessage($message) { $allowedChars = '/^[a-zA-Z0-9,@. ]*$/'; return preg_match($allowedChars, $message); } if ($_SERVER["REQUEST_METHOD"] === "POST") { if (isset($_POST['submit'])) { $name = $_POST['name']; $phone = $_POST['phone']; $email = $_POST['email']; $subject = $_POST['subject']; $message = $_POST['message']; date_default_timezone_set("Asia/Kolkata"); $currentTime = date("Y-m-d H:i:s"); $errors = array(); // Validate input if (empty($name)) { $errors[] = "Name field is required."; } elseif (!preg_match('/^[a-zA-Z ]+$/', $name)) { $errors[] = "Name can only contain alphabets."; } if (empty($email)) { $errors[] = "Email field is required."; } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $errors[] = "Invalid email format."; } if (empty($phone)) { $errors[] = "Phone field is required."; } elseif (!preg_match('/^\d{10}$/', $phone)) { $errors[] = "Phone number should have exactly 10 digits."; } // Sanitize input $name = filter_var($name, FILTER_SANITIZE_STRING); $phone = filter_var($phone, FILTER_SANITIZE_NUMBER_INT); $email = filter_var($email, FILTER_SANITIZE_EMAIL); $message = htmlspecialchars($message, ENT_QUOTES, 'UTF-8'); // Check for potentially malicious content in the message if (!isAllowedMessage($message)) { $errors[] = "Your message contains potentially malicious content or disallowed characters."; } if (empty($errors)) { // Your existing code for successful submission $query = "INSERT INTO `tbl_queries` (`name`, `phone`, `email`,`subject`, `message`, `datetime`) VALUES (?, ?, ?, ?, ?, ?)"; $stmt = mysqli_prepare($db, $query); if ($stmt) { mysqli_stmt_bind_param($stmt, "ssssss", $name, $phone, $email,$subject, $message, $currentTime); $result = mysqli_stmt_execute($stmt); mysqli_stmt_close($stmt); if ($result) { $to = "amitdelhi051@gmail.com"; // $to = "digitalsaleem12@gmail.com"; $subject = "New Query Submitted From Bhatia Taxi Service"; $emailMessage = "A new query has been submitted:\n\n"; $emailMessage .= "Name: $name\n"; $emailMessage .= "Phone: $phone\n"; $emailMessage .= "Email: $email\n"; $emailMessage .= "Tour Name: $subject\n"; $emailMessage .= "Message: $message\n"; $headers = "From: $email"; if (mail($to, $subject, $emailMessage, $headers)) { echo "<script> window.alert('Successfully Sent! We will contact you soon'); window.location.href = 'contact.html'; </script>"; } else { echo "Error sending email."; } } else { $errors[] = "Error in processing your request. Please try again later."; } } else { $errors[] = "Error in preparing the statement."; } } else { // Display validation errors in an alert echo "<script> var errorMessage = '"; foreach ($errors as $error) { echo addslashes($error) . "\\n"; } echo "'; window.alert(errorMessage); </script>"; } } } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <?php include "links.php";?> <title><?php echo $datacontact["site_pages_meta_title"];?></title> <meta name="description" content="<?php echo $datacontact["site_pages_meta_description"];?>"> </head> <body> <?php include "header.php";?> <div class="breadcrumb breadcrumb-style-one"> <div class="container"> <div class="col-lg-12 text-center"> <h2 class="breadcrumb-title">Contact <span class="lst-words">Us</span></h2> <ul class="d-flex justify-content-center breadcrumb-items"> <li class="breadcrumb-item"><a href="<?php echo $wspath;?>">Home</a></li> <li class="breadcrumb-item active">Contact Us</li> </ul> </div> </div> </div> <div class="contact-wrapper pt-100"> <div class="container"> <div class="row align-items-center justify-content-lg-center gy-5"> <div class="col-lg-6"> <form action="<?php $_PHP_SELF?>" method="POST" id="contact_form"> <div class="contact-form-wrap"> <h4>Get a free quote now</h4> <p>Your email address will not be published. Required fields are marked *</p> <div class="row"> <div class="col-lg-6"> <div class="custom-input-group"> <!--<label for="name">Name</label>--> <input type="text" placeholder="Your name" id="name" name="name"> </div> </div> <div class="col-lg-6"> <div class="custom-input-group"> <!--<label for="name">Phone No</label>--> <input type="text" placeholder="Your Number" id="name" name="phone"> </div> </div> <div class="col-lg-6"> <div class="custom-input-group"> <!--<label for="email">Email</label>--> <input type="text" placeholder="Your Email" id="email" name="email"> </div> </div> <div class="col-lg-6"> <div class="custom-input-group"> <!--<label for="email">Email</label>--> <input type="text" placeholder="Tour Name" id="email" name="subject"> </div> </div> </div> <div class="custom-input-group"> <textarea cols="20" rows="7" placeholder="Your message" name="message"></textarea> </div> <div class="custom-input-group"> <div class="submite-btn"> <button type="submit" name="submit">Send Message</button> </div> </div> </div> </form> </div> <div class="col-lg-5"> <div class="contact-info"> <h3>Contact <span class="lst-words">Info.</span></h3> <ul> <li> <h6>Let’s Talk</h6> <a href="mailto:<?php echo $data1['email']?>"><span> </span> <?php echo $data1['email']?></a> <a href="tel:<?php echo $data1['phone']?>"><?php echo $data1['phone']?></a> </li> <li> <h6>Loacation.</h6> <p> <?php echo $data1['address']?> </p> </li> <li> <h6>Visit Us.</h6> <a href="<?php echo $data1['facebook_link'];?>"><i class='bx bxl-facebook' style="font-size: 20px;"></i></a> <a href="<?php echo $data1['insta_link'];?>"><i class='bx bxl-instagram-alt' style="font-size: 20px;"></i></a> <a href="<?php echo $data1['twitter_link'];?>"><i class='bx bxl-twitter' style="font-size: 20px;"></i></a> <a href="https://wa.me/<?php echo $data1['whatsapp'];?>"><i class='bx bxl-whatsapp' style="font-size: 20px;"></i></a> </li> </ul> </div> </div> </div> </div> <div class="container-fluid p-0"> <div class="contact-map mt-120"> <div class="mapouter"> <div class="gmap_canvas"> <iframe src="<?php echo $data1['map_link']?>" width="100%" height="250" frameborder="0" style="border:0" allowfullscreen=""></iframe> <a href="https://123movies-to.org/"></a><br> </div> </div> </div> </div> </div> <?php include "inner-footer.php";?> <?php include "footer.php";?> </body> </html>