query('SELECT * FROM `confirmpasswd` WHERE `login` = "?s" AND `passwd` = "?s" AND `date` = "?s" AND `active` = "?s"', $login, $passwd, $timev, 1);
if ($sql->getNumRows() == 0) die("Ссылка устарела!");
$sql = $sql->fetch_assoc();
db::c()->query('UPDATE `users` SET `pass` = "?s" WHERE `login` = "?s"', md5($passwd), $sql['login']);
db::c()->query('UPDATE `confirmpasswd` SET `active` = "?s" WHERE `login` = "?s" AND `passwd` = "?s" AND `date` = "?s" AND `active` = "?s"', 0, $login, $passwd, $timev, 1);
} else echo "Ссылка устарела.";
?>