Ver Mensaje Individual
  #1 (permalink)  
Antiguo 31/07/2009, 15:44
machacca
 
Fecha de Ingreso: junio-2007
Mensajes: 17
Antigüedad: 16 años, 10 meses
Puntos: 0
Reemplazos a file_get_contents , fopen, curl

Hola. necesito abrir un feed, bueno tengo una funcion que funciona perfectamente, tengo problemas con esto que me sale esto:

URL file-access is disabled in the server configuration in sites/1/iespana.es/t/a/takiy-djboy/site/index.php on line 12

probe con los que muestro abajo pero nada, por favor pueden ayudarme con una funcion que remmplace a file_get_contens, fopen, file, implode, curl que me abra y me imprima correctamente, pues no tengo acceso a la configuracion php.ini pues ahi se puede hacer cambios.


file_get_contents
Código PHP:
<?php
$homepage 
file_get_contents('h t t p : / / w w w  . t a k i y. n e t/feed/');
echo 
$homepage;
?>
fopen
Código PHP:

<?php
$homepage 
fopen("h t t p :/ / w w w . t a ki y . n e t /f e e d /""r");
?>


Curl
Código PHP:

if (function_exists('curl_init')) {
   
// initialize a new curl resource
   
$ch curl_init();
   
// set the url to fetch
   
curl_setopt($chCURLOPT_URL$url);

   
// don't give me the headers just the content
   
curl_setopt($chCURLOPT_HEADER0);

   
// return the value instead of printing the response to browser
   
curl_setopt($chCURLOPT_RETURNTRANSFER1);

   
// use a user agent to mimic a browser
   
curl_setopt($chCURLOPT_USERAGENT'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0');

   
$content curl_exec($ch);

   
// remember to always close the session and free all resources
   
curl_close($ch);
} else {
   echo 
" esta funcione sta desactivada";


tambien probe con esto
Código PHP:
implode (""file ($url)); 
pues con estos siempres me sale URL file-access is disabled in the server configuration in sites/1/iespana.es/t/a/takiy-djboy/site/index.php on line 12



Ayuda por favor

Última edición por machacca; 31/07/2009 a las 16:21