Файл: top.php
Строк: 13
<?php
include 'ini.php';
head();
$mode = isset($_GET['sex']) ? $_GET['sex'] : NULL;
switch($mode)
{
case 'girls':
$resg = mysql_query("SELECT * FROM `users` WHERE `sex` = '2' ORDER BY RAND() LIMIT 5");
while($g = mysql_fetch_array($resg))
{
if ($g['photo'] == 0)
{
echo '<img src="img/no.gif" alt=""><br/>';
}
else {
echo '<img src="foto?src=photo/'.$g['id'].'.jpg" alt=""><br/>';
}
echo '<a href="users?id='.$g['id'].'">'.$g['login'].'</a>, '.($g['sex'] == 1 ? 'м' : 'ж').', '.$g['age'].', '.$city.' <img src="img/on.png" alt=""><br/>';
}
echo '<br/><a href="top?sex=girls">Показать других девушек</a>';
break;
case 'mans':
$resm = mysql_query("SELECT * FROM `users` WHERE `sex` = '1' ORDER BY RAND() LIMIT 5");
while($m = mysql_fetch_array($resm))
{
if ($m['photo'] == 0)
{
echo '<img src="img/no.gif" alt=""><br/>';
}
else {
echo '<img src="foto?src=photo/'.$m['id'].'.jpg" alt=""><br/>';
}
echo '<a href="users?id='.$m['id'].'">'.$m['login'].'</a>, '.($m['sex'] == 1 ? 'м' : 'ж').', '.$m['age'].', '.$city.' <img src="img/on.png" alt=""><br/>';
}
echo '<br/><a href="top?sex=mans">Показать других парней</a>';
break;
}
foot();
?>