表单html和发送者php
我正在尝试在html页面上创建一个发送两封电子邮件的表单。下面是html代码:表单html和发送者php,php,html,Php,Html,我正在尝试在html页面上创建一个发送两封电子邮件的表单。下面是html代码: <form class="pix-form-style pixfort-form pix-padding-top-20 pix-form-light-white-bg" action="invio_mail.php" method="POST"> <div class="form-group">
<form class="pix-form-style pixfort-form pix-padding-top-20 pix-form-light-white-bg" action="invio_mail.php" method="POST">
<div class="form-group">
<input type="text" class="form-control" name="first_name" placeholder="Nome">
</div>
<div class="form-group">
<input type="text" class="form-control" name="last_name" placeholder="Cognome">
</div>
<div class="form-group">
<input type="email" class="form-control" name="email" placeholder="Email">
</div>
<div class="form-group">
<input type="text" name="city" class="form-control" placeholder="Città">
</div>
<div class="form-group">
<input type="text" name="phone" class="form-control" placeholder="Numero telefono">
</div>
<button type="submit" class="btn yellow-bg small-text btn-lg pix-white btn-block"><span class="pix_edit_text"><strong>Richiedi informazioni</strong></span></button>
<div class="form-group" style="color:white; display: flex;">
<input type="checkbox" id="checkbox" name="policies" value="" style="margin-left: 10px; margin-right: 5px;height:auto !important;" required><p>Dichiaro di aver letto ed accettato l'informativa</p>
</div>
</form>
Richiedi informazioni
我是一个信息提供者
这里是php
<?php if(isset($_POST['submit'])){
$to = "my-email@webmail.com"; // email azienda
$from = $_POST['email']; // email cliente
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$city = $_POST['city'];
$policies= $_POST['policies'];
$subject = "Richiesta Informazioni";
$subject2 = "Copia Richiesta Informazioni";
$message = $first_name . " " . $last_name . " " . $email . " " . $phone . " " . $city . " " . $policies;
$message2 = $first_name . " " . $last_name . " " . $email . " " . $phone . " " . $city . " " . $policies;
$headers = "From:" . $from;
$headers2 = "From:" . $to;
mail($to,$subject,$message,$headers);
mail($from,$subject2,$message2,$headers2);
echo "Richiesta Inviata! " . $first_name . ", ti contatteremo al più presto.";
}?>
我明白了
405错误-不允许使用HTTP谓词访问此页。
无法显示您正在查找的页面,因为尝试访问时使用了无效的方法(HTTP谓词)
如果您得到
404
,则表示页面地址错误。请检查文件名是否相同,路径是否相同。从您的代码invio_mail.php
应该与HTML位于同一目录中。是这样吗?如果您得到403
您需要检查您的服务器日志以更好地了解您为什么使用该谢谢您的回答,是的,我检查了文件名和路径,它们是正确的。是的,php和html在同一个目录中。我得到405-不允许使用HTTP谓词访问此页面。无法显示您正在查找的页面,因为尝试访问时使用了无效的方法(HTTP谓词)。检查服务器日志错误我不熟悉php,我做了研究,并试图使它们适应我的需要。已经给了我一个更正的起点,谢谢你为什么要在php文件中添加脚本标记site path.com/test/sender\u mail/invio\u mail.php“>