-2
我有我的聯繫方式是這樣兩個單選按鈕:單選按鈕,不發送信息
<div class="field form-inline radio">
<input class="radio" type="radio" name="response" value="ATTENDING" /><span>Blalala 1</span>
</div>
<div class="field form-inline radio">
<input class="radio" type="radio" name="response" value="NOT ATTENDING" /><span>Blablabla 2</span>
</div>
/* ... */
<div class="form-group col-xs-12 floating-label-form-group controls">
<label>Name</label>
<input type="text" class="form-control" placeholder="Name" id="name" required data-validation-required-message="Write your name">
<p class="help-block text-danger"></p>
</div>
,然後從互聯網上一些通用的contact_me.php這樣的:
<?php
// Check for empty fields
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['phone']) ||
empty($_POST['message']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
echo "No arguments Provided!";
return false;
}
$name = $_POST['name'];
$email_address = $_POST['email'];
$message = $_POST['message'];
$phone = $_POST['phone'];
$response = $_POST['response'];
/* ... */
$email_body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email_address\n\nPhone: $phone\n\nResponse: $response\n\nMessage:\n$message";
/* ... */
但是無論怎樣嘗試,總是在我收到的電子郵件中響應字段始終爲空。我谷歌很多,沒有任何幫助。我希望你可以!
其餘的代碼是從模板,它的工作原理,我添加了兩個單選按鈕,無法工作。
什麼的var_dump($ _ POST);說(把它放在$ email_body之前)?收音機在
你使用哪種形式的方法?你可以加 – devpro
並在其他條件下添加你的成功塊 – devpro