Kjapp og trygg hosting for Wordpress

file_get_contents error

Tonny Kluften

Administrator
Jeg får denne meldinga:
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in...

Og prøver å hente fila med
<?php
$a = file_get_contents('http://domene.no/includes/fil.php');
echo ($a);
?>

Er det noen måte å få hentet den fila på når det ikke går med file_get_contents?
 

Børge AJ

Medlem
Du kan prøve cURL?

Fra manualen:
PHP:
<?php
        // create curl resource
        $ch = curl_init();

        // set url
        curl_setopt($ch, CURLOPT_URL, "example.com");

        //return the transfer as a string
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

        // $output contains the output string
        $output = curl_exec($ch);

        // close curl resource to free up system resources
        curl_close($ch);     
?>
 
Topp