tenho um script daqui mas quando site não existe ele exibe erro..
Segue script
[CODEBOX]
<?php
class site
{
var $url;
function site($site)
{
$this->url = $site;
}
function verifica()
{
if(isset($this->url))
{
$metatags = get_meta_tags($this->url);
$metatags['description'] = empty($metatags['description']) ? 'Em branco' : $metatags['description'];
$metatags['keywords'] = empty($metatags['keywords']) ? 'Em branco' : $metatags['keywords'];
$metatags['author'] = empty($metatags['author']) ? 'Em branco' : $metatags['author'];
//print("<div style='font-size:11px;font-family:tahoma;'>");
//print("Site existe!<br>");
print("META TAGS:<br>");
print("<strong>Description:</strong> ".$metatags['description']."<br>");
print("<strong>Keywords:</strong> ".$metatags['keywords']."<br>");
print("<strong>Author:</strong> ".$metatags['author']."<br>");
print("</div>");
}else{
print("Preencha um site");
}
}
}
$site = new site("http://www.diretorio...-online.com.br");
$site->verifica();
?>[/CODEBOX]
Edição feita por: Dudu, 10/06/2009, 14:03.