[Resolvido]Error no str_get_html.php
Tou com um erro no meu script e não sei identificar erra pra ele exibir a imagem do usuário mas isso não está acontecendo
Error:
/monthly_2018_11/image.png.48b21000113c7a2e154a5666e678f964.png" />
funcao.php:
function ver_avatar($nick){
include 'str_get_html.php';
$url = "http://pt.clubcooee.com/users/view/".$nick;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
$return = curl_exec($ch);
curl_close($ch);
$html = str_get_html($return);
$res = $html->find('.m33 img');
$imgLink = $res[0]->attr['src'];
return $imgLink;
}
str_get_html.php:
<?php
function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
{
$dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
if (empty($str) || strlen($str) > MAX_FILE_SIZE)
{
$dom->clear();
return false;
}
$dom->load($str, $lowercase, $stripRN);
return $dom;
}
?>
menu.php:
<div class="usr-nav">
<img src="<?php $veavt = ver_avatar($usr); echo $veavt; ?>" class="img-usr">
<p class="name-usr">Nome do Usuário</p>
</div>
Me Ajudem mas rápido possível pfvrrrrDiscussão (1)
Carregando comentários...