config.php
[php]
<?php
$host = ‘localhost’;
$user = ‘usuario’;
$db = ‘base_de_datos’;
$password = ‘clave_de_usuario’;
$link = mysql_connect($host, $user, $password);
if (!$link) {
die(‘No se pudo conectar al servidor : ‘ . mysql_error());
}
if (! mysql_select_db($db) ) {
die (‘No se encontro la base de datos’ . mysql_error());
}
?>
[/php]
verspam.php
[php]
<?php
require("config.php");
$sql = "SELECT comment_author_IP FROM wp_comments WHERE comment_approved=’spam’";
$result = mysql_query($sql);
$cantidad = sizeof($result);
//echo "<table border=’1′>";
//echo "<tr><td><b>#</b></td><td><b>IP</b></td></tr>";
$i=0;
if($cantidad>0){
while($row = mysql_fetch_array($result)){
$i++;
$ipComentario = $row[‘comment_author_IP’];
//echo "<tr><td>$i</td><td>$ipComentario</td></tr>";
echo $ipComentario."<br>";
}
}
//echo "</table>";
?>
[/php]