Files
vij/page-subscript.php
2023-05-13 00:33:13 +03:00

45 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
get_header();?>
<div id="content">
<h1 id="mainpage-title">Подписка на рассылку</h1>
<div id="fulltext">
<?if (isset($_POST['email'])) {
$email = trim($_POST['email']);
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
$hash = md5('775+'.$email);
$date_insert = date('Y-m-d H:i:s');
$add_sub_sql = "INSERT INTO {$wpdb->prefix}subusers (mail, status, hash, date) VALUES ('$email', '1', '$hash', '$date_insert')";
$result = $wpdb->get_results($add_sub_sql); ?>
<p>Спасибо, мы включили Ваш e-mail!</p>
<p>Наши письма могут оказаться в разделе "Рассылки" Вашего почтового приложения или сайта.</p>
<? } else { ?>
<p>Мы не можем добавить Вас в нашу рассылку.</p>
<p>Адрес электронной почты недействительный.</p>
<? }
}?>
</div>
</div>
<?php get_footer();