Fsockopen

Discussion in 'Co-op Advertising Network' started by caroline, May 18, 2005.

  1. #1
    My host doesn't support fsockopen, it was disabled a few weeks ago. How should I modify the code?

    <?php
    // Last update: May 2, 2005 8:45 pm

    function file_get_contents_an ($url) {
    if (substr ($url, 0, 7) == 'http://') {
    $url = parse_url ($url);
    $handle = fsockopen ($url['host'], 80);
    fwrite ($handle, "GET $url[path]?$url[query] HTTP/1.0\r\nHost: $url[host]\r\nConnection: Close\r\n\r\n");
    while (!feof($handle)) {
    $string .= fread($handle, 40960);
    }
    $string = explode ("\n", $string);
    $string = array_pop ($string);

    Somebody mentioned the curl function, anybody help me?
     
    caroline, May 18, 2005 IP
  2. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #2
    Seach DP for CURL code. I posted the example here twice I believe.
     
    noppid, May 18, 2005 IP