· 7 years ago · Jan 21, 2019, 08:00 AM
1if(isset($_POST['submit'])) {
2
3 require 'dist/PHPMailer/PHPMailerAutoload.php';
4 $mail = new PHPMailer;
5
6 $name = $_POST['name'];
7 $email = $_POST['email'];
8 $subject = $_POST['subject'];
9 $phone = $_POST['phone'];
10 $company = $_POST['company'];
11 $message = $_POST['message'];
12 $secretKey = "--KEY--";
13 $responseKey = $_POST['g-recaptcha-response'];
14 $userIP = $_POST['REMOTE_ADDR'];
15
16 $url = "https://www.google.com/recaptcha/api/siteverify?secret=$secretKey&response=$responseKey&remoteip=$userIP";
17 $response = file_get_contents($url);