PHP
- 1 ответ
- 0 вопросов
1
Вклад в тег
<div class="form-01 consult-form js-consult-form__content">
<h2 class="form-01__title">Обратная связь</h2>
<form class="form-01__form" name="contact-form" method="post" action="https://###.ooo/assets/php/contact.php">
<div class="form__item form__item--03">
<input type="text" name="name" placeholder="Ваше Имя"/>
</div>
<div class="form__item form__item--03">
<input type="text" name="phone" placeholder="Ваш Телефон"/>
</div>
<div class="form__item form__item--03">
<input type="email" name="email" placeholder="Ваш Email"/>
</div>
<div class="form__item">
<textarea rows="5" name="message" placeholder="Сообщение"></textarea>
</div>
<div class="form__button">
<button type="submit" class="btn btn-primary btn-w180">Отправить</button>
</div>
<div>
<input type="checkbox" id="agree" name="agree"
required>
<label for="agree">Текст о защите данных</label>
</div>
</form>
</div>
$name2 = $_POST['name2'];
$email = $_POST['email'];
if ($_POST['name2']!='' || $_POST['email2']!=''){
die('Сообщение не отправлено,так как ты бот');
}
<div class="form-01 consult-form js-consult-form__content">
<h2 class="form-01__title">Обратная связь</h2>
<form class="form-01__form" name="contact-form" method="post" action="https://###.ooo/assets/php/contact.php">
<div class="form__item form__item--03">
<input type="text" class="validator" name="name2" placeholder="Ваше Имя">
<input type="text" class="validator" name="email2" placeholder="Ваш Email">
<input type="text" name="name" placeholder="Ваше Имя"/>
</div>
<div class="form__item form__item--03">
<input type="text" name="phone" placeholder="Ваш Телефон"/>
</div>
<div class="form__item form__item--03">
<input type="email" name="email" placeholder="Ваш Email"/>
</div>
<div class="form__item">
<textarea rows="5" name="message" placeholder="Сообщение"></textarea>
</div>
<div class="form__button">
<button type="submit" class="btn btn-primary btn-w180">Отправить</button>
</div>
<div>
<input type="checkbox" id="agree" name="agree"
required>
<label for="agree">Текст о защите данных</label>
</div>
</form>
</div>