Server IP : 103.53.40.154 / Your IP : 3.133.151.90 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/thewebshop.co.in/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php ob_start(); require_once("includes/dbsmain.inc.php"); $page_name=basename($_SERVER['PHP_SELF'],'.php'); include("site-main-query.php"); $sess_id=session_id(); $site_url=$compDATA['admin_website_url']; $author = str_replace("http://","","$site_url"); ?> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script> <?php $name=$_POST['name']; $phone=$_POST['phone']; $email=$_POST['email']; $message=$_POST['message']; if(isset($_POST['enq'])){ $sub="Enquiry"; }else{ $sub="Contact"; } if($name=="") { echo "<script>alert('Please enter your name!');</script>"; }else if (!preg_match("/^[a-zA-Z-' ]*$/",$name)) { echo "<script>alert('Only letters and white space allowed!');</script>"; }else if($email=="") { echo "<script>alert('Please enter an email address!');</script>"; }else if(!filter_var($email, FILTER_VALIDATE_EMAIL)){ echo "<script>alert('Invalid email address!');</script>"; }else if(empty($phone) ) { echo "<script>alert('Please enter a mobile number!');</script>"; }else if(!preg_match('/^[0-9]{10}+$/', $phone)) { echo "<script>alert('Please enter a valid mobile number!');</script>"; }else { $sql="insert into tbl_enquiry set enquiry_name='$name', enquiry_mobile='$phone', enquiry_email='$email', enquiry_detail='$message', enquiry_source='Contact Us', enquiry_add_date=now()"; db_query($sql); //if(!empty($name) && !empty($phone) && !empty($email) && !empty($message) ){ $hostName = $_SERVER['HTTP_HOST']; $msgmail="<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /> <title>The Web Shop</title> </head> <body> <table align='center' cellSpacing='0' cellPadding='0' width='87%' border='1' style='border:1px solid #e61938'> <tbody> <tr> <td vAlign='top' style='background-color:#e61938; padding:10px;font-family:Verdana, Arial, Helvetica, sans-serif; font-size:16px; color:#ffffff; text-align:center; font-weight:bold; text-decoration:none;' colspan='3' >$sub From $hostName</td> </tr> <tr> <td width='30%' vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#003366; background-color:#F9E2DD;padding:10px;' ><strong>Name</strong> </td> <td vAlign='top' width='70%' style='font-family:Verdana, Arial, Helvetica, sans-serif;padding:10px;'>$name</td> </tr> <tr> <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#003366; background-color:#F9E2DD;padding:10px;' ><strong>Mobile </strong> </td> <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif;padding:10px;'>$phone</td> </tr> <tr> <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#003366; background-color:#F9E2DD;padding:10px;' ><strong>Email-Id</strong> </td> <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif;padding:10px;'>$email</td> </tr> <tr> <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#003366; background-color:#F9E2DD;padding:10px;' ><strong>Detail </strong> </td> <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif;padding:10px;'>$message</td> </tr> </tbody> </table> </body> </html>"; $toEmail = $compDATA['admin_email']; $subject = "$sub from $hostName"; $from="$email"; $Headers1 = "From: $name<$from>\n"; $Headers1 .= "X-Mailer: PHP/". phpversion(); $Headers1 .= "X-Priority: 3 \n"; $Headers1 .= "MIME-version: 1.0\n"; $Headers1 .= "Content-Type: text/html; charset=iso-8859-1\n"; if(@mail("$toEmail", "$subject", "$msgmail","$Headers1")){?> <script> $(document).ready(function(){ $("#myModal").modal("show"); var sub1="<?=$_POST['enq']?>"; if(sub1!=""){ setTimeout(function(){ window.location.href="index.html"; }, 2000); }else{ setTimeout(function(){ window.location.href="contact.html"; }, 2000); } }); </script> <?php }else{?> <script> $(document).ready(function(){ $("#myModal1").modal("show"); var sub1="<?=$_POST['enq']?>"; if(sub1!=""){ setTimeout(function(){ window.location.href="index.html"; }, 2000); }else{ setTimeout(function(){ window.location.href="contact.html"; }, 2000); } }); </script> <?php } ///////////////****** Mailer to client end here **********************////////////// } ?> <!-- Modal --> <div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-body" style="background-color:rgba(100, 17, 165,0.7);"> <div style="margin-top:10px;"> <h4><b style="color:white;">Thank you for showing your interest,</b></h4> <h4><b style="color:white;">We will contact you shortly...</b> </h4> </div> </div> </div> </div> </div> <!-- Modal Error--> <div class="modal fade" id="myModal1" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-body" style="background-color:rgba(100, 17, 165,0.7);"> <div style="margin-top:10px;"> <h4><b style="color:white;">Error,</b></h4> <h4><b style="color:white;">Something went wrong...</b> </h4> </div> </div> </div> </div> </div>