Y
Y
Yura2016-03-04 06:49:28
CMS
Yura, 2016-03-04 06:49:28

Contact form, sender Server, what's wrong?

Good day,
I have such a contact form on the site (Business card site on html + php), my problem is that when a request comes from the contact form, the sender's email is always the server and not the visitor's email, how to make the contact form correctly so that when the letter came, was the sender's email and not the server's?

?php
$post = (!empty($_POST)) ? true : false;
if($post)
{
$name = htmlspecialchars($_POST["name"]);
$tel = htmlspecialchars($_POST["tel"]);
$email = htmlspecialchars($_POST["email"]);
$budjet = htmlspecialchars($_POST["budjet"]);
$comment = htmlspecialchars($_POST["comment"]);
$place = htmlspecialchars($_POST["place"]);



$error = "";


 if(!$error)
{
$sub = 'Поступила новая заявка';
$message ="Поступила новая заявка\n\nИмя - ".$name."\nТелефон - ".$tel."\nEmail - ".$email."\nБюджет - ".$budjet."\nКомментарий к заказу - ".$comment."\nФорма с которой поступила заявка - ".$place  ;

$mail = mail("тут мой емайл", $sub, $message,"Content-type:text/plain; charset = utf-8");

if($email)
{
echo 'OK';
}
}




}
?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Khokhlov, 2016-03-04
@andrhohlov

The user sends data to you, the server receives it, processes it and sends you a letter with it.
The server sends the email, not the user.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question