Jump to content

Problema con file_get_contents y curl


Perrotekel

Recommended Posts

Hola tengo un servidor dedicado en 1and1 y no me funciona ninguna de estas dos funciones, podeis decirme como hacer que funcionen o de que manera traerme una imagen de una url que me funcione?.


Este es mi codigo


$url="http://xxxxxxx";
//Metodo 1
  $content = file_get_contents($url);
  echo "prueba1:".$content;
//Metodo 2
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt ($ch, CURLOPT_URL, $url );
  $html = curl_exec ( $ch );
  curl_close($ch);   
  echo "prueba2:" . $html;




Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...