io ho trovato questo esempio molto simile al tuo, sul manuale di php
usa fwrite invece di fputs ma mi sa che non è quello il problema
Codice PHP:
<?php
$fp 
fsockopen("www.example.com"80$errno$errstr30);
if (!
$fp) {
    echo 
"$errstr ($errno)
\n"
;
} else {
    
$out "GET / HTTP/1.1\r\n";
    
$out .= "Host: [url]www.example.com\r\n[/url]";
    
$out .= "Connection: Close\r\n\r\n";
    
fwrite($fp$out);
    while (!
feof($fp)) {
        echo 
fgets($fp128);
    }
    
fclose($fp);
}
?>