Custom Form
PAÍS
Nombre
Telefono
ORDENAR
"; echo "Por favor, instale o cURL\n"; echo "Para sistemas UNIX, digite no terminal:\n"; echo "sudo apt-get install curl && apt-get install php-curl\n"; die; } // Montar os argumentos da requisição $args = [ 'api_key' => $api_key, 'name' => $name, 'phone' => $phone, 'offer_id' => $offer_id, 'country_code' => $country_code, 'price' => $price, 'base_url' => $base_url, 'referrer' => $referrer, 'ip' => $ip, 'subacc' => $subacc, ]; // Construir a URL para a requisição $url = API_URL . "?" . http_build_query($args); // Inicializar cURL $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, )); // Executar a requisição e fechar o cURL $res = curl_exec($curl); curl_close($curl); // Decodificar a resposta da API $res = json_decode($res, true); // Verificar a resposta da API if ($res['code'] == 'ok') { $_SESSION['printname'] = $name; $_SESSION['printphone'] = $phone; header("Location: success.php"); // Redirecionar para a página de sucesso echo $res['msg'] . " - " . $res['order_id']; echo "
"; } else { echo $res['error']; }