Little help with a error please.

Discussion in 'PHP' started by iamsgf, Nov 29, 2007.

  1. #1
    I just moved servers for one of my site and am now getting a display error of some kind! I am not a programmer so I have no idea what it is.

    Here is the error:

    Warning: file(): URL file-access is disabled in the server configuration in /home/content/X/X/X/XXXXX/html/flightstoaustralia/travelsearch/sflight.php on line 9

    Warning: file(http://b.XXXXXXXXXX.com/flights/sea...00000&text=&text2=&fixedDeptPt=&fixedArrPt=): failed to open stream: no suitable wrapper could be found in /home/content/X/X/X/XXXXX/html/flightstoaustralia/travelsearch/sflight.php on line 9

    PHP FILE CONTENT - sflight.php

    <?php

    $link = '
    <script language="javascript" src="http://b.XXXXXXXXXXXXXX.com/flights/searchbox.aspx?s=468x100&a=62644&r=&t=0,1,0,0&c=000099,000000&text=&text2=&fixedDeptPt=&fixedArrPt="></script>
    ';

    $link = substr($link,strpos($link,"src=")+5);
    $link = substr($link,0,strpos($link,"\">"));
    $html = implode('', file($link));
    $html = str_replace("#000099", "",$html);
    $html = substr($html,16);
    $html = str_replace(".divcal{", ".divcal{ left:0px; top:0px;",$html);
    $html = str_replace("<style>.mar", "<style> body{background-color: transparent;} .mar",$html);
    $html = str_replace("div_txt_calendar_6\"","div_txt_calendar_6\" style=\"posibiont:absolute; left:0px; top:0px\"",$html);
    $html = str_replace("\\'","'", $html);
    $html = substr($html,0,strlen($html)-2);
    $html = "<BR>".$html;
    echo $html;
    die();
    ?>

    Can anyone point me in the right direction of what i need to do!

    Thanks
     
    iamsgf, Nov 29, 2007 IP
  2. Kwaku

    Kwaku Well-Known Member

    Messages:
    1,217
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    140
    #2
    The admin of the server disabled URL usage for the fopen command. I would say, try CURL instead, but if you are not a programmer...
     
    Kwaku, Nov 29, 2007 IP
    iamsgf likes this.
  3. Kwaku

    Kwaku Well-Known Member

    Messages:
    1,217
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    140
    #3
    Some examples;
    function _fopenurl($url) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POST, 0);
    return curl_exec($ch);
    }

    But I guess you need to tweak some to get it working IF your admin does allow that.
     
    Kwaku, Nov 29, 2007 IP
  4. iamsgf

    iamsgf Active Member

    Messages:
    982
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    85
    #4
    managed to turn on the fopen command.

    Thanks all working
     
    iamsgf, Nov 29, 2007 IP