Answer the question
In order to leave comments, you need to log in
How to do a reCAPTCHA check?
There is a form with inputs and with google recaptcha
Data from the form is sent to
server.php
pages
<form action="server.php" method="POST">
<input type="text" name="name" placeholder="Ваше имя">
<input type="phone" name="phone" placeholder="Ваш телефон">
<input type="text" name="email" placeholder="Ваша почта">
<div class="g-recaptcha" data-sitekey="6LcCsWoUAAAAAO520lKAXtblM0p76KNXL3n0dVUZ"></div>
<button type="submit" name="submit">Отправить</button>
</form>
if(isset($_POST['submit'])){
$to = "[email protected]";
$from = "[email protected]";
$name = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
/* Переменная, которая будет отправлена на почту со значениями, вводимых в поля */
$mail_to_myemail = "
Имя: $name
Номер телефона: $phone
Почта $email";
$headers = "From: $from \r\n";
/* Отправка сообщения, с помощью функции mail() */
mail($to, $mail_to_myemail, $headers . 'Content-type: text/plain; charset=utf-8');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question