Файл: colxoz.ru/user_pass.php
Строк: 25
<?
include './system/common.php';
include './system/functions.php';
include './system/user.php';
if(!$user OR $user['access']!=2) {
header('location: /');
exit;
}
$title = "Пароль";
include './system/h.php';
$us=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".abs(intval($_GET['id']))."'"));
if(!$us)
{
header("Location:/");
exit;
}
if(isset($_GET['change'])){
$newp=_string($_POST['password']);
mysql_query("UPDATE `users` SET `password`='$newp' WHERE `id`='$us[id]'");
echo "Пароль изменен";
}
?>
<form action='?id=<?=$us['id'];?>&change' method='post'>
Имя пользователя:<br/>
<input name='login' value='<?=$us['login'];?>' disabled/><br/>
Пароль:<br/>
<input name='password' value='<?=$us['password'];?>'/><br/>
<input type='submit' value='Сохранить'/>
</form>
<?
include './system/f.php';
?>