There is a form:
<form method="POST" action="<?=$_SERVER['SCRIPT_NAME']?>"> <input type="tel" name="tel" placeholder="Введите номер телефона"> <input type="submit" name="submit" value="Заказать"> </form> PHP code:
if (isset($_POST['submit'])) { $tel = $_POST['tel']; echo $tel; $to = "admin@ukr.net"; $subject = "Заказ обратного звонка с сайта"; $message = $tel; mail($to, $subject, $message, "From: no-reply@alkonarkostop.com.ua\r\n"); echo "TRUE"; } else{ echo "false"; } Why is the if condition not working?