title: fputs GET to curl
body: <p>I have this script which requires <code>allow_url_fopen = On</code> which is not a good idea and I want to change <code>curl</code>.  I'll appreciate if any one can help me out with how to do the <code>fputs GET</code>.   </p>
  
  <pre><code>$SH = fsockopen($IP, $Port, $errno, $errstr, 30);
  echo $errstr;    
  #$ch = curl_init();
  #curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  #curl_setopt($ch, CURLOPT_URL, $IP.":".$Port);
  #curl_setopt ($ch, CURLOPT_HEADER, 0);
      if ($SH){ 
          fputs($SH,"GET /7.html HTTP/1.0\r\nUser-Agent: S_Status (Mozilla Compatible)\r\n\r\n");
          $content = "";
          while(!feof($SH)) { 
              $content .= fgets($SH, 1000);
              #content .= curl_setopt($ch, CURLOPT_FILE, $SH);
          }
          fclose($SH);
          #curl_close($ch);
  }
  </code></pre>