From 52e7eb1be41c630737a7b22e23c8b33c46c26df5 Mon Sep 17 00:00:00 2001 From: ssbg04 Date: Sat, 6 Jun 2026 09:46:59 +0800 Subject: [PATCH] Fix: FormSubmit with ReCaptcha --- send_contact.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/send_contact.php b/send_contact.php index abd454c..4a31278 100644 --- a/send_contact.php +++ b/send_contact.php @@ -98,10 +98,17 @@ curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($_POST)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_TIMEOUT, 15); +$domain = $_SERVER['HTTP_HOST'] ?? 'crischarles.page.gd'; +$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https://" : "http://"; +$fullUrl = $protocol . $domain . $_SERVER['REQUEST_URI']; + curl_setopt($ch, CURLOPT_HTTPHEADER, [ - 'Accept: application/json' + 'Accept: application/json', + 'Origin: ' . $protocol . $domain, + 'Referer: ' . $fullUrl, + 'X-Forwarded-For: ' . $clientIp ]); -curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'); +curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] ?? 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);