Server IP : 103.53.40.154 / Your IP : 3.22.42.189 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/joshidiagnosticcentre.com/../arcsol.in/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php include_once('admin/config.php'); if ($_SERVER["REQUEST_METHOD"] === "POST") { if (isset($_POST['submit'])) { $name = $_POST['name']; $phone = $_POST['phone']; $email = $_POST['email']; $message = $_POST['message']; 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."; } if (empty($phone)) { $errors[] = "Phone field is required."; } elseif (!preg_match('/^\d{10}$/', $phone)) { $errors[] = "Phone number should have exactly 10 digits."; } if (!empty($message)) { $message = htmlspecialchars($message); // Sanitize the message input } if (empty($errors)) { $query = "INSERT INTO `tbl_queries` (`name`, `phone`, `email`, `message`) VALUES (?, ?, ?, ?)"; $stmt = mysqli_prepare($db, $query); mysqli_stmt_bind_param($stmt, "ssss", $name, $phone, $email, $message); $result = mysqli_stmt_execute($stmt); mysqli_stmt_close($stmt); if ($result) { // Sending email // $to = "saifinoushad294@gmail.com"; $to = "digitalsaleem12@gmail.com"; $subject = "New Query Submitted"; $emailMessage = "A new query has been submitted:\n\n"; $emailMessage .= "Name: $name\n"; $emailMessage .= "Phone: $phone\n"; $emailMessage .= "Email: $email\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 = '$wspath' + 'contact.html'; </script>"; } else { echo "Error sending email."; } } else { echo "Error"; } } } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Contact - ARC Solution</title> <?php include 'top-link.php';?> </head> <body> <?php include 'header.php';?> <!-- breadcrumb area --> <div class="breadcrumb-area breadcrumb-padding bg-img" style="background-image:url(<?php echo $wspath?>assets/images/bg/bg-3.jpg)"> <div class="container"> <div class="breadcrumb-content text-center"> <h2>Contact</h2> <ul> <li><a href="<?php echo $wspath?>">Home</a></li> <li><i class="fa fa-angle-right"></i></li> <li>Contact</li> </ul> </div> </div> </div> <!-- Project area --> <div class="section section-padding"> <div class="container"> <div class="row"> <div class="col-lg-5 col-md-6"> <div class="contact-info-wrap"> <div class="single-contact-info-wrap"> <div class="info-icon"> <i class="dlicon ui-1_home-51"></i> </div> <div class="info-content"> <h3 class="title">Address</h3> <p class="width"> <?php echo $datac["address"]; ?> </p> </div> </div> <div class="single-contact-info-wrap"> <div class="info-icon"> <i class="dlicon ui-2_phone"></i> </div> <div class="info-content"> <h3 class="title">Phone</h3> <p> Mobile: <span><a href="tel:<?php echo $datac["phone"]; ?>"><?php echo $datac["phone"]; ?></a></span></p> <p> Mobile: <span><a href="tel:<?php echo $datac["alt_phone"]; ?>"><?php echo $datac["alt_phone"]; ?></a></span></p> </div> </div> <div class="single-contact-info-wrap"> <div class="info-icon"> <i class="dlicon ui-1_email-85"></i> </div> <div class="info-content"> <h3 class="title">Email</h3> <p><a href="mailto:<?php echo $datac["email"]; ?>"> <?php echo $datac["email"]; ?> </a></p> </div> </div> <div class="single-contact-info-wrap"> <div class="info-icon"> <i class="dlicon ui-2_share"></i> </div> <div class="info-content"> <h3 class="title">Follow us</h3> <div class="social-icon-style mt-4"> <a class="facebook" target="_blank" href="<?php echo $dataf["facebook_link"]; ?>"><i class="fa fa-facebook"></i></a> <a class="twitter" target="_blank" href="<?php echo $dataf["twitter_link"]; ?>"><i class="fa fa-twitter"></i></a> <a class="google-plus" target="_blank" href="<?php echo $dataf["insta_link"]; ?>"><i class="fa fa-instagram"></i></a> <a class="behance" target="_blank" href="<?php echo $dataf["pinterest_link"]; ?>"><i class="fa fa-linkedin"></i></a> </div> </div> </div> </div> </div> <style> .error{ color:red; } </style> <div class="col-lg-7 col-md-6"> <div class="contact-from-wrap"> <form action="<?php $_PHP_SELF?>" method="post"> <input name="name" type="text" placeholder="Name" required> <?php if (isset($errors) && in_array("Name field is required.", $errors)) { ?> <p class="error">Name field is required.</p> <?php } elseif (isset($errors) && in_array("Name can only contain alphabets.", $errors)) { ?> <p class="error">Name can only contain alphabets.</p> <?php } ?> <input name="email" type="email" placeholder="Email" required> <?php if (isset($errors) && in_array("Email field is required.", $errors)) { ?> <p class="error">Email field is required.</p> <?php } ?> <input name="phone" type="text" placeholder="Phone" id="phone_no" minlength="10" maxlength="10" onkeypress="return isNumberKey(event)" pattern=".{10,10}" class="form-control" required="" onpaste="return false;" required> <?php if (isset($errors) && in_array("Phone field is required.", $errors)) { ?> <p class="error">Phone field is required.</p> <?php } elseif (isset($errors) && in_array("Phone number should have exactly 10 digits.", $errors)) { ?> <p class="error">Phone number should have exactly 10 digits.</p> <?php } ?> <textarea name="message" placeholder="Your Message"></textarea> <input class="submit" type="submit" name="submit" value="Send Message"> </form> <!-- <p class="form-messege"></p> --> </div> </div> </div> <div class="map mt-6 mt-md-12"> <iframe src="<?php echo $datac["map_link"]; ?>" width="100%" height="100%" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe> </div> </div> </div> <?php include 'footer.php';?>