Бойцовский Мир. Подтверждение операции через e-mail.
if ($_GET['id']!='' && $_GET['code']!='') {
define('GAME',true);
include ("_incl_data/class/__db_connect.php");
$confirm = mysql_query("SELECT * FROM `emailconfirmation` WHERE `id` = '".mysql_real_escape_string($_GET['id'])."' AND `code` = '".mysql_real_escape_string($_GET['code'])."' AND (`active` = '1' OR `pass` = '1' OR `email` = '1' OR `qu_an` = '1')");
if (mysql_num_rows($confirm) == 0 or mysql_num_rows($confirm) == '') die("
Ссылка устарела!
");
$confirm = mysql_fetch_array($confirm,MYSQL_ASSOC) or die("Ошибка обработки запроса!!");
if($confirm['active'] == 1) {
mysql_query("UPDATE `users` SET `emailconfirmation` = '1', `securetime` = '".(time()+259200)."' WHERE `id` = '".mysql_real_escape_string($confirm['id'])."'");
echo "
Подтверждение смены пароля/email через почту включено
";
}elseif($confirm['pass'] == 1) {
mysql_query("UPDATE `users` SET `pass` = '".mysql_real_escape_string($confirm['pa_em'])."', `securetime` = '".(time()+259200)."' WHERE `id` = '".mysql_real_escape_string($confirm['id'])."'");
echo "
Удачно сменили пароль
";
}elseif($confirm['email'] == 1) {
mysql_query("UPDATE `users` SET `email` = '".mysql_real_escape_string($confirm['pa_em'])."', `securetime` = '".(time()+259200)."' WHERE `id` = '".mysql_real_escape_string($confirm['id'])."'");
echo "
";
}
mysql_query("DELETE FROM `emailconfirmation` WHERE `id` = '".mysql_real_escape_string($_GET['id'])."' AND `code` = '".mysql_real_escape_string($_GET['code'])."'");
}else{?>
}?>