Hey.
Situation:
There is a web form to receive an email address to which the link to download the file will be sent.
<form action="downloads.php" method="post"> <input type="email" name="sender_email" placeholder="Ваш электронный адрес..."> <input type="submit" name="send" value="Получить ссылку!"> </form>
Problem
I wrote the code for the downloads.php file:
//если пользователь нажал кнопку отправить if (isset($_POST['send'])){ //получаем email $email = $_POST['sender_email']; //создаем письмо для отправки $to = 'my@mail.ru'; $subject = 'Зарос загрузки файла с сайта'; $message.= 'Email:'.$email.'\n'; if (mail($to, $subject, $message)) echo 'Ссылка на загрузку файла отправлена на указанный Вами электронный адрес'; else echo 'Ссылка не отправлена'; }
There is not enough handler to send the link to the email address of the user who entered his email in the web form, and the lines where you need to write the link to download the file, that is, it should be as a message.
Help to add the code.