View file info.php

File size: 2.74Kb
<?php
####################
# Автор: [Svig]    #
# ICQ: 563000172   #
####################

include ("conf.php");
include ("lock.php");

if ($user == $myrow["user"] && $pass == $myrow["pass"])
{
if (isset($_GET['id'])) {$id = mysql_real_escape_string(trim($_GET['id']));}


$result = mysql_query("SELECT * FROM userlist WHERE id='$id'",$db);
$myrow = mysql_fetch_array($result);

if (mysql_num_rows($result) > 0)
{
$result2 = mysql_query("SELECT * FROM userlist WHERE id='$id'",$db);
$myrow2 = mysql_fetch_array($result2);
$new_view = $myrow2['view'] + 1;
$update = mysql_query("UPDATE userlist SET view='".$new_view."' WHERE id='".$id."'",$db);
}
$result3 = mysql_query("SELECT * FROM userlist WHERE id='$id'",$db);
$myrow3 = mysql_fetch_array($result3);
if($id != $myrow3['id'])
{
include ("head.php");
echo "<div class='nav'>";
echo "Данного пользователя не существует!<br />";
echo "</div>";
echo "<div class='nav'>";
echo "• <a href=menu.php?user=$user&pass=$pass>В меню</a>";
echo "</div>";
include ("foot.php");
exit();
}




include ("head.php");

echo "<div class='nav'>";
echo "<b>Анкета:</b> ".$myrow['user']."<br />";
echo "</div>";
echo "<div class='nav'>";

if($myrow['photo'] != '0')
{ echo "<img align='center' src='photos/".$myrow['id'].".".$myrow['photo']."'>"; }
else { echo "<img src='img/foto.png'>"; }

echo "</div>";
echo "<div class='nav'>";
echo "<b>Имя:</b> ".$myrow['name']." <br />";
echo "<b>Пол:</b> ".$myrow['pol']." <br />";
if ($myrow['gor'] != ''){
echo "<b>Город:</b> ".$myrow['gor']." <br />";
}
if ($myrow['phone'] != ''){
echo "<b>Телефон:</b> ".$myrow['phone']." <br />";
}
if ($myrow['email'] != ''){
echo "<b>E-mail:</b> ".$myrow['email']." <br />";
}
if ($myrow['icq'] != ''){
echo "<b>ICQ:</b> ".$myrow['icq']." <br />";
}
if ($myrow['os'] != ''){
echo "<b>О себе:</b> ".$myrow['os']." <br />";
}
echo "<b>Дата регистрации:</b> ".$myrow['datereg']." <br />";


echo "<b>Просмотров анкеты:</b> ".$myrow["view"]."<br />";

echo "</div>";
echo "<div class='nav'>";
echo "• <a href='messages.php?mode=add2&users=".$myrow['user']."&user=".$user."&pass=".$pass."'>Написать сообщение</a><br />";
echo "• <a href='friends.php?mode=get&user_nick=".$myrow['user']."&user=".$user."&pass=".$pass."'>Добавить в друзья</a><br />";
echo "</div>";
echo "<div class='nav'>";
echo "• <a href=menu.php?user=$user&pass=$pass>В меню</a>";
echo "</div>";
include ("foot.php");
exit();
}
else
{
echo "Ошибка! Неверный <b>Ник</b> или <b>Пароль</b><br />";
echo <<<sss
<a href="index.php">На главную</a>
sss;
}

?>