Mam pytanie. Jak zmienić nagłówki wysyłane przez curl. Głównie chodzi mi tu o contect-type. Chodź ustawiam nagłówki niby na sztywno, to kiedy nagłówki wyswietlam wyskakuje
[...]Content-type: text/html X-powered-by: PHP/4.4.1 Transfer-encoding: chunked[...]
zamiast ustawionego
"Content-Type: application/x-www-form-urlencoded"
Skrypt ma na celu wysylanie smsa z bramki. Oto moj kod
<?php
$naglowki = array(
"Host: sms2.horrify.org",
"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11",
"Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
"Accept-Language: pl,en-us;q=0.7,en;q=0.3",
"Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7",
"Keep-Alive: 300",
"Connection: keep-alive",
"Referer: http://sms.ikp.pl/?",
"Content-Type: application/x-www-form-urlencoded"
);
$curl = curl_init('http://sms2.horrify.org/');
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_NOBODY, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, $naglowki);
curl_setopt($curl, CURLOPT_POSTFIELDS, "status=send&siec=600&nr=&number2=000000&tresc=tekst&od=podp&wapacz=&x=0&y=0" );
curl_setopt($curl, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($curl, CURLOPT_COOKIEFILE, "cookies.txt");
curl_setopt($curl, CURLOPT_POST, TRUE );
curl_exec($curl);
curl_close($curl);
?>