prepare($sql); $query->execute(); $result = $query->fetch(PDO::FETCH_OBJ); if ($result) { $adminemail = $result->emailId; } else { throw new Exception("Admin email not found in database."); } } catch (Exception $e) { echo ""; exit; } if (isset($_POST['submit'])) { // Sanitize and validate input $name = htmlspecialchars(trim($_POST['name'])); $phoneno = htmlspecialchars(trim($_POST['phonenumber'])); $email = filter_var(trim($_POST['emailaddres']), FILTER_VALIDATE_EMAIL); $subject = htmlspecialchars(trim($_POST['subject'])); $course=$_POST['course']; $services=$_POST['services']; $address=$_POST['address']; $message = htmlspecialchars(trim($_POST['message'])); $captcha = htmlspecialchars(trim($_POST['captcha'])); if($captcha=="" || !isset($_SESSION['captcha'])){ echo ""; echo ""; exit; } if($_SESSION['captcha']!=$captcha){ echo ""; echo ""; exit; } if (!$email) { echo ""; echo ""; exit; } $uip = $_SERVER['REMOTE_ADDR']; $isread = 0; // Insert query try { $sql = "INSERT INTO tblcontactdata (FullName, PhoneNumber, EmailId, Subject, Course, Services, Address, Message, UserIp, Is_Read, captcha) VALUES (:fname, :phone, :email, :subject,:course,:services,:address, :message, :uip, :isread, :captcha)"; $query = $dbh->prepare($sql); // Bind parameters $query->bindParam(':fname', $name, PDO::PARAM_STR); $query->bindParam(':phone', $phoneno, PDO::PARAM_STR); $query->bindParam(':email', $email, PDO::PARAM_STR); $query->bindParam(':subject', $subject, PDO::PARAM_STR); $query->bindParam(':course',$course,PDO::PARAM_STR); $query->bindParam(':services',$services,PDO::PARAM_STR); $query->bindParam(':address',$address,PDO::PARAM_STR); $query->bindParam(':message', $message, PDO::PARAM_STR); $query->bindParam(':uip', $uip, PDO::PARAM_STR); $query->bindParam(':isread', $isread, PDO::PARAM_INT); $query->bindParam(':captcha', $captcha, PDO::PARAM_INT); $query->execute(); $lastInsertId = $dbh->lastInsertId(); if ($lastInsertId) { // Mail function for sending mail $to = $adminemail; // Use fetched admin email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type: text/html;charset=iso-8859-1"."\r\n" ; $headers .= 'From: Euwellness ' . "\r\n"; // Change this to a valid domain $headers .= 'Cc: customercare@aartonpaints.com' . "\r\n"; $subject = "aaertonpaints Contact Enquiry!"; $ms = ""; $ms .= "
Name: $name
"; $ms .= "
Phone Number: $phoneno
"; $ms .= "
Email Id: $email
"; $ms .= "
Services: $services,
"; $ms .= "
address: $address,
"; $ms .= "
Feedback: $message
"; $ms .= ""; if (mail($to, $subject, $ms, $headers)) { $_SESSION['form_submitted'] = "yes"; echo ""; } else { echo ""; } echo ""; } else { throw new Exception("Failed to insert data into database."); } } catch (Exception $e) { echo ""; echo ""; } } ?> JUST IN CASE

Contact Us

Feel free to drop us a line and we'll get back to you in 24 hours...

Just In Case Private Limited

Alattuchira PO

PO Box 10006

Pin-683544 Valiyapara

Chettinada

Perumbavoor, Ernakulam District

KERALA, INDIA

 

 

General Enquiries

WhatsApp: 0091-79945 89896

Tel: +91 70250 12330

Mail: justincasetissues@gmail.com

Your Name

Email Address

Phone Number

Address

Feedback


Find