D
D
Dima2018-10-15 21:18:59
PHP
Dima, 2018-10-15 21:18:59

Why is the variable not being written?

5bc4d9a63e7ff791667206.png
The form has fields. All names are transmitted and sent by post, but only Static lines come.

<?php
header('Content-Type: text/html; charset=utf-8');
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";

$name=  $_POST["name"];
$tel = $_POST["tel"];
$mail = $_POST["mail"];
$city = $_POST["city"];
$comment = $_POST["comment"];
$message="
Имя:".$name."<br>
Тел:".$tel."<br>
Почта:".$mail."<br>
Город:".$city."<br>
Комментарий:".$comment."<br>

";
mail("[email protected]","Обратная связь",$message,$headers);     	  ?>

Why are empty variables coming?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey, 2018-10-15
Dolgoter @SpiderPigAndCat

\print_r($_POST) what output?

K
krypt3r, 2018-10-16
@krypt3r

$name= $_REQUEST["name"];
etc.

S
Stanislav Shendakov, 2018-10-16
@shindax

so or
$name= $_GET["name"];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question