Problème avec curl

Blasters -  
NHenry Messages postés 15219 Date d'inscription   Statut Modérateur Dernière intervention   -
Salut, j'utilise une fonction curl :
<?php 
function look($habboname)
{
    $url = "http://www.hbeta.fr/user_profile.php?name=".$habboname;

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_USERAGENT, 'HabboBETA API');
    $data = curl_exec($ch);
    curl_close($ch);

    $look = explode('http://www.hbeta.fr/imaging/avatar.php?figure=', $data);
    $look = explode('&size=b&direction=4&head_direction=4', $look[1]);
    $look = trim($look[0]);
    return $look;
}
$pseudo = "AxS";

?>
<?php echo look($pseudo); ?>


La fonction marche bien en localhost sous XAMPP 5.6.11 mais lorsque je met en ligne la fonction sur l'hebergeur, cela m'affiche rien alors qu'en localhost ca m'affiche le code que je voulai
http://www.dailybeta.ga/dailybeta_api2.php?pseudo=AxS

Quelqu'un pourrait m'aider? SVP.
Cordialement

1 réponse

NHenry Messages postés 15219 Date d'inscription   Statut Modérateur Dernière intervention   365
 
Question bête, est-ce que ton hébergeur a CURL sur ses serveurs et autorise-t-il les connexions vers l'extérieur ?
1