
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php
// Target Hyundai API URL
$url = "https://www.hyundai.com/wsvc/template_ar/spa/common/mail/commonSendMail.html";

// Form data extracted from the network request
$data = [
    'loc' => 'MYNAGHI',
    'lang' => 'ar',
    'mail_title' => 'msg_mail_Special_offers_title',
    'image_title' => 'mailing_title_special_offer',
    'first_name' => 'Khurram',
    'last_name' => 'M Asif',
    'phone' => '0565849999',
    'email' => 'na@na.com',
    'recv_email' => 'digitalsales@hyundai.mynaghi.com',
    'recv_name' => '',
    'both_send' => '',
    'page_title' => 'Special Offers',
    'dealer_city' => 'جدة',
    'customers_bank' => 'البنك الراجحي',
    'dealer_branch' => 'معرض السيارات - اتو مول',
    'preferred_time_to_call' => '',
    'vehicles' => 'كريتا',
    'purchase_plan' => '1 شهر',
    'monthly_salary' => 'من 5,000 الى 10,000',
    'dealer_city_en' => 'Jeddah',
    'dealer_branch_en' => 'Auto Mall Showroom',
    'send_vehicle_en' => 'Creta',
    'customers_bank_en' => 'AlRajhi Bank',
    'purchase_plan_en' => '1 month',
    'monthly_salary_en' => 'Between 5,000 and 10,000',
    'preferred_time_to_call_en' => '',
    'sourcee' => 'GoogleADV-CORE3',
    'page_sub' => 'Ramadan2025-Venu-Kona-Tucson',
    'i18n_lang' => 'ar_je',
    'lan' => 'ar'
];

// Convert array to URL-encoded string
$postFields = http_build_query($data);

// Initialize cURL session
$ch = curl_init();

// Set cURL options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

// Add request headers (matching your browser request)
$headers = [
    "Content-Type: application/x-www-form-urlencoded",
    "Accept: application/json, text/javascript, */*; q=0.01",
    "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
    "Referer: https://www.hyundai.com/mynaghi/ar/build-a-car/special-offers/ramadan25-SCS.html"
];

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

// Execute cURL request
$response = curl_exec($ch);

// Check for errors
if (curl_errno($ch)) {
    echo 'cURL Error: ' . curl_error($ch);
} else {
    echo "Response: " . $response;
}

// Close cURL session
curl_close($ch);
?>