Fix: FormSubmit with ReCaptcha

This commit is contained in:
ssbg04 committed 2026-06-06 09:46:59 +08:00
1 parent c12d9fb5e3
commit 52e7eb1be4
1 file changed
+9 -2
+9 -2
View File
@@ -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);