我一直试图制作我的第一份联系表格,经过几小时的谷歌搜索,我似乎无法在我的代码中找到错误,为什么它不起作用。
我的PHP代码:
<?php
$to = 'llavert@gmail.com';
$from = strip_tags($_POST['email']);
$name = strip_tags($_POST['name']);
$adress = strip_tags($_POST['address']);
$city = strip_tags($_POST['city']);
$subject = strip_tags($_POST["subject"]);
$message = strip_tags($_POST['message']);
$header = "From: noreply@example.com\r\n";
$header.= "MIME-Version: 1.0\r\n";
$header.= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$header.= "X-Priority: 1\r\n";
mail($to, $subject, $message, $header);
print_r(error_get_last());
&GT;
我的HTML格式:
<form method="post" action="mailer.php">
<input type="text" class="col-md-13 col-xs-12 name" name='name' placeholder='Naam *'/>
<input type="text" class="col-md-13 col-xs-12 Email" name='email' placeholder='Email *'/>
<input type="text" class="col-md-13 col-xs-12 name" name='address' placeholder='Straat en huisnummer *'/>
<input type="text" class="col-md-13 col-xs-12 Email" name='city' placeholder='Postcode en gemeente *'/>
<input type="text" class="col-md-12 col-xs-12 Subject" name='subject' placeholder='Onderwerp *'/>
<textarea type="text" class="col-md-12 col-xs-12 Message" name='message' placeholder='Bericht aan BDS bvba *'></textarea>
<div class="cBtn col-xs-12">
<ul>
<li class="clear"><a href="#"><i class="fa fa-times"></i>Formulier legen</a></li>
<li class="send" name="submit" type="submit" value="Send"><i class="fa fa-share"></i>Bericht sturen</a></li>
</ul>
<br><br><br><br><br><br><br><br><br>
</div>
</form>