ciao a tutti,
nel server dove mi trovo, mi negano l'utilizzo di fopen...
Mi hanno detto di provare con fsocketopen ma non riesco a venirne fuori, mi da questo errore
Connessione fallita: 136658444 Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?
questo il codice utilizzato (ho messo google come prova)
$host="http://www.google.it/" ;
$target="";
$port=8080;
$timeout=60;
$protocol="HTTP/1.0" ;
$br="\r\n" ;
$sk=fsockopen($host,$port,$errnum,$errstr,$timeout ) ;
if(!is_resource($sk)){
exit("Connessione fallita: ".$errnum." ".$errstr) ;
}
else{
$headers="GET ".$target." ".$protocol.$br ;
$headers.="Accept: image/gif, image/x-xbitmap, image/jpeg".$br ;
$headers.="Accept-Language: dialetto veneto".$br ;
$headers.="Host: ".$host.$br ;
$headers.="Connection: Keep-Alive".$br ;
$headers.="User-Agent: Socket-PHP-browser 1.0".$br;
$headers.="Referer: http://www.bwbwabwa.it".$br ;
$headers.="X-INVENTATO: Ciao a tutti".$br.$br;
fputs($sk,$headers) ;
$dati="" ;
while (!feof($sk)) {
$dati.= fgets ($sk,2048);
}
}
fclose($sk) ;
echo($dati) ;