我正在创建一个很长的表单,并且并非所有字段都会得到答复,如何在他们点击发送按钮并收到电子邮件后隐藏未答复的字段?
所以我想知道的是,在发送提交按钮后,我可以在脚本中添加什么来隐藏空白字段。
/* Data Variables */
$email = $_POST['email'];
$name = $_POST['name'];
$phone = $_POST['phone'];
$uplift = $_POST['uplift'];
$upliftc = $_POST['upliftc'];
$city = $_POST['city'];
$post = $_POST['post'];
$delivery = $_POST['delivery'];
$deliveryc = $_POST['deliveryc'];
$city2 = $_POST['city2'];
$post2 = $_POST['post2'];
$ground = $_POST['ground'];
$second = $_POST['second'];
$second2 = $_POST['second2'];
$ground2 = $_POST['ground2'];
$internal =$_POST['internal'];
$internal2 =$_POST['internal2'];
$external =$_POST['external'];
$external2 =$_POST['external2'];
$access =$_POST['access'];
$queen = $_POST['queen'] * 1.7;
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Phone; $phone <br>
<br>
Uplift; $uplift <br>
Continued; $upliftc <br>
City; $city <br>
Post Code; $post <br>
<br>
Delivery Address; $delivery <br>
Continued; $deliveryc <br>
City; $city2 <br>
Post; $post2 <br>
<br>
Uplift; <br>
Ground Floor; $ground <br>
Second Floor; $second <br>
Internal Stairs; $internal <br>
External Stairs; $external <br>
<br>
Delivery; <br>
Ground Floor; $ground2 <br>
Second Floor; $second2 <br>
Internal Stairs; $internal2 <br>
External Stairs; $external2 <br>
Truck Access; $access <br>
Queen Bed; $queen <br>