Просмотр файла mailn.php

Размер файла: 728B
<?php
include 'inc/db.php';
include 'inc/1.php';
if (!$user)header("Location: /aut.php");
$q=mysql_query("SELECT * FROM `mail` WHERE `to` = '$user[id]' AND `read` = '0'");
$a=array();
while ($f=mysql_fetch_assoc($q)){
$a[]=$f['from'];
}
$v=array_unique($a);
$c=count($v);
$b=0;
$o=1;
while ($b<$c){
//$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$v[$b]'"));
$ank=gus($v[$b]);
$count=mysql_num_rows(mysql_query("SELECT * FROM `mail` WHERE `to` = '$user[id]' AND `read` = '0' AND `from` = '$v[$b]'"));
echo "<div class='p".($o%2)."'>".im($ank['id'])." <a href='mail.php?id=$v[$b]'>".htmlspecialchars($ank['name'])."</a> ($count)</div>";
$b++;
$o++;
}
include_once 'inc/foot.php';
?>