File size: 1.57Kb
<?php
include'inc/conf.php';
session_start();
$sql = mysql_query("SELECT * FROM `users` WHERE `id` = '".$_SESSION['id']."' ");
$row = mysql_fetch_array($sql);
$pass = htmlspecialchars(stripslashes($_SESSION['pass']));
$id = htmlspecialchars(stripslashes($_SESSION['id']));
$ids = htmlspecialchars(stripslashes($_GET['ids']));
if ($id == $row['id'] and md5($pass)==$row['pass']){
$user = mysql_query("SELECT * FROM `city` WHERE `id`='".$ids."'");
$user_s=mysql_num_rows($user);
////////////////////////////////////////////////////////////////
if(empty($_GET)){
$title='Путишествие по миру';
include'inc/up.php';
echo'<div class="rek">Капитан '.$row['login'].'! Куда направимся? Полный Вперед!</div>
';
$sql2 = mysql_query("SELECT * FROM `city`");
while($city = mysql_fetch_array($sql2)){
if($row['lvl']>=$city['lvl_min']){
echo'<div class="post"><a href="teleport.php?ids='.$city['id'].'">'.$city['name'].'</a></div>';
}else{
echo'<div class="post"><font color="#F33">'.$city['name'].'</font>, от '.$city['lvl_min'].' ур.</div>';
}
}
echo'<div class="opis">Чтобы попасть в желаемый город, нажми на нужный город.</div>';
}
$user = mysql_query("SELECT * FROM `city` WHERE `id`='".$ids."'");
$user_s=mysql_num_rows($user);
if(is_numeric($_GET['ids'])){
if($user_s!==0){
$sql = mysql_query("UPDATE `users` SET `city` = '".$ids."'");
header("Location: city.php");} else{
header("Location: city.php");
}
}
}
include'inc/foot.php';
?>