Greetings The site has 5 different forms. The script saves the variable data from the fields (name, mail, phone) and sends them to my mail. It is necessary to make it so that, in addition to all the information that users of the site will enter, the content of the letter indicated the name of the form with which the message was sent. How can this be realized?
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Обратная связь</title> <meta http-equiv="Refresh" content="4; URL=http://"> </head> <body> <?php $sendto = "@gmail.com"; $username = $_POST['name']; $usertel = $_POST['telephone']; $usermail = $_POST['email']; $usluga = $_POST['usl']; // Формирование заголовка письма $subject = "Новое сообщение"; $headers = "From: " . strip_tags($usermail) . "\r\n"; $headers .= "Reply-To: ". strip_tags($usermail) . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html;charset=utf-8 \r\n"; // Формирование тела письма $msg = "<html><body style='font-family:Arial,sans-serif;'>"; $msg .= "<h2 style='font-weight:bold;border-bottom:1px dotted #ccc;'>Cообщение с сайта</h2>\r\n"; $msg .= "<p><strong>От кого:</strong> ".$username."</p>\r\n"; $msg .= "<p><strong>Почта:</strong> ".$usermail."</p>\r\n"; $msg .= "<p><strong>Телефон:</strong> ".$usertel."</p>\r\n"; $msg .= "</body></html>"; // отправка сообщения if(@mail($sendto, $subject, $msg, $headers)) { echo "<center><img src='images/spasibo.png'></center>"; } else { echo "<center><img src='images/ne-otpravleno.png'></center>"; } ?> </body> </html>
<input type="hidden" value="name form">webref.ru/html/input/type - Visman