game/mailconf.php
2022-06-07 00:30:34 +03:00

50 lines
2.0 KiB
PHP

<?
function GetRealIp(){
if (!empty($_SERVER['HTTP_CLIENT_IP']))
return $_SERVER['HTTP_CLIENT_IP'];
else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
return $_SERVER['HTTP_X_FORWARDED_FOR'];
return $_SERVER['REMOTE_ADDR'];
}
define('IP',GetRealIp());
include('_incl_data/__config.php');
define('GAME',true);
include('_incl_data/class/__db_connect.php');
if(isset($_GET['mail'])) {
$key = md5('mailconf*15+'.$_GET['mail']);
if($_GET['key'] != $key) {
echo 'Êëþ÷ íå ñîâïàäàåò, íàïèøèòå Àäìèíèñòðàöèè ïî E-mail: admin@new-combats.com';
}elseif(isset($_GET['cancel'])) {
//Îòêàç îò ðàññûëêè
echo 'Âû îòêàçàëèñü îò ðàññûëêè íà ýë.ïî÷òó: <b>'.$_GET['mail'].'</b>.';
}else{
//
$mcf = mysql_fetch_array(mysql_query('SELECT * FROM `mini_actions` WHERE `var` = "'.mysql_real_escape_string($_GET['mail']).'" LIMIT 1'));
$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$mcf['uid'].'" LIMIT 1'));
//Ïîäïèñàíèå íà ðàññûëêó
if(!isset($user['id'])) {
echo 'Çàðåãèñòðèðóéòåñü ÷òîáû ïðèâÿçàòü ýë.ïî÷òó <b>'.$_GET['mail'].'</b> ê ïåðñîíàæó.';
}else{
$bank = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `uid` = "'.$mcf['uid'].'" ORDER BY `id` DESC LIMIT 1'));
if($mcf['ok'] > 0) {
echo 'Âû óæå ïîäòâåðæäàëè ýòîò E-mail ðàíåå! <b>'.date('d.m.Y H:i:s',$mcf['ok']).'</b>';
}elseif(!isset($bank['id'])) {
echo 'Ñíà÷àëà ñîçäàéòå ñ÷åò â èãðîâîì áàíêå, ÷òîáû ìû ñìîãëè ïåðåâåñòè òóäà 1 åêð.';
}else{
//
mysql_query('UPDATE `mini_actions` SET `ok` = "'.time().'" WHERE `id` = "'.$mcf['id'].'" LIMIT 1');
mysql_query('UPDATE `bank` SET `money2` = `money2` + 1 WHERE `id` = "'.$bank['id'].'" LIMIT 1');
//
echo 'Âû óñïåøíî ïîäïèñàëèñü íà ðàññûëêó íîâîñòåé äëÿ ýë.ïî÷òû <b>'.$_GET['mail'].'</b>, íà ñ÷åò ïåðñîíàæà <b>'.$user['login'].'</b> çà÷èñëåí 1 åêð.';
}
}
}
}else{
echo 'E-mail íå íàéäåí.';
}
echo '<br><br>- - - - - - -<br><br>Ñ óâàæåíèåì,<br>Àäìèíèñòðàöèÿ &copy; <a href="https://new-combats.com/">new-combats.com</a>';
?>