Tell me please. Has never worked with php before. I wrote my first file handler of the form, but with errors, I do not understand where ((
Here is the form
<form action="./post.php" method="POST"> <div class="sbtn col-md-12 text-center"> <input class="name form-input" type="text" placeholder="NAME" name="name"> <input class="email form-input" type="email" placeholder="EMAIL" name="email"> <input class="email form-input" type="phone" placeholder="PHONE" name="phone"> <input class="message form-input" type="text" placeholder="MASSAGE" name="message"> <input type="hidden" name="uri" value="'<php echo $_SERVER['REQUEST_URI']; ?>'"> <input type="hidden" name="site" value="'<php echo $_SERVER['SERVER_NAME']; ?>'"> <input class="submit-btn" type="submit" value="SEND"> </div> </form>
Here is the .php file
<?PHP //-------------------// $adminemail="ksu_dp@ua.fm"; $sender="___"; $subject="Новая заявка! ____"; $backurl="_______"; //------------------------------------ $name=$_POST['name']; $email=$_POST['email']; $msg=$_POST['message']; $phone=$_POST['phone']; $source= $uri=$_POST['uri']; $site=$_POST['site']; //--------------------------------// mail("$adminemail", "Отправитель: \n $sender", "Тема: \n $subject", "Имя: \n $name", "Телефон: \n $phone", "Источник: \n $source", "Сайт: \n $site", "Страница входа: \n $uri"); //------------------// print "<script language='Javascript'><!-- function reload() {location = \"$backurl\"}; setTimeout('reload()', 3000); //--></script> <p>Thank you for leaving the application. We will call you soon!</p>"; exit; ?>
Flips to the contents of the file post.php when you click on submit. And nothing comes to the specified email.
Thanks if someone tell me