Problème avec curl

Fermé
Blasters - Modifié par Blasters le 12/12/2015 à 15:25
NHenry Messages postés 15113 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 22 avril 2024 - 12 déc. 2015 à 16:32
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 15113 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 22 avril 2024 331
12 déc. 2015 à 16:32
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