http://stackoverflow.com/questions/2749200...=active#tab-top
Dostaję jednak cały czas taki błąd:
Cytat
Warning: fsockopen() [function.fsockopen]: unable to connect to http://strona.pl/plik/plik.doc:80 (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?) in /home/
Mój kod wygląda tak:
$host = "http://strona.pl/"; $httpReq = "POST /" . $path . " HTTP/1.0\r\n"; $httpReq .= "Host: ".$host."\r\n"; $httpReq .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; pl; rv:1.9.1.2) Gecko/20090729 desktopsmiley_2_2_5643778701369665_44_71 DS_gamingharbor Firefox/3.5.2 (.NET CLR 3.5.30729)\r\n"; $httpReq .= "Host: " . $host . "\r\n"; $httpReq .= "Content-Type: text/xml\r\n"; $httpReq .= "Content-Disposition: attachment; filename=\"".$filename[1]."\"\r\n\r\n"; } }
jako path, podaję URI, np. download/files/my_music.mp3 bo chyba to należało tam wstawić. Mimo wszystko, kod nie działa. Może mi ktoś powiedzieć co jest nie tak?