file_get_contents() alternative

Discussion in 'PHP' started by Hobbit2, Dec 21, 2006.

  1. #1
    I just bought a script, but it won't work because DreamHost doesn't allow file_get_contents()

    They provided me with an alternative but I can't seem to make it work because I'm not an experienced php programmer. http://wiki.dreamhost.com/index.php/CURL

    Can someone help me? My msn is add me please - I would post it here but it's not an open source script. I'm out of paypal cash, but I can provide you a free link to a site that gets 2-3k uniques per day.

    Thanks.

    EDIT: The script is really small, only two files so it should be pretty easy (for someone who knows php).
     
    Hobbit2, Dec 21, 2006 IP
  2. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #2
    Try fopen, should be much easier.

    
    $file = fopen($file,'r');
    while($cont = fread($file,1024536)){
    $file_content .= $cont;
    }
    fclose($file);
    
    PHP:
    Peace,
     
    Barti1987, Dec 21, 2006 IP
  3. Hobbit2

    Hobbit2 Active Member

    Messages:
    720
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #3
    The problem was solved. Someone added me and helped me. Thanks (H).
     
    Hobbit2, Dec 21, 2006 IP
  4. szalinski

    szalinski Peon

    Messages:
    341
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    isn't fopen() disabled also, if file_get_contents() is? and file() also? (for remote urls)
     
    szalinski, Mar 27, 2009 IP