电子邮件发送成功,但输入值未显示在电子邮件中。$cargo
是应该显示的那个。请帮帮我...
查看页面代码
<div class="col-lg-6 col-md-6 mt-3">
<label>Container Number</label>
<input type="text" class="form-control" name="<?php if (!$ifCntrDbExists) {echo 'cntr_no_edit_add[]';} else {echo 'cntr_no_new[]';} ?>" value="<?php echo $transdbrow['cntr_no'] . ' ' . $transdbrow['no_of_cntr'];?>">
</div>
代码如下:
if (isset($_POST['submit']) && isset($_POST['sendMail']))
{
$select = $_POST['datanew']['co_cd'];
$bill=$_POST['datanew']['bl_no'];
$cargo=$_POST['transdbrow']['cntr_no']['transdbrow']['no_of_cntr'];
$email = "example@gmail.com";
$message = '<tr> <td><h2><strong>Dear </strong>'. $select.'
<h3>We would like to update you about your transaction with below details. <br>
BL #: '.$bill."<br>
Container #: ".$cargo."
<br>
Recent Updates as of ". date('F d,Y h:i A') . " </h3></td><tr> " ;
$headers = 'mime_content_type(filename)E-Version: 1.0' . "rn";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
$headers .= "From: example@gmail.com" . "rn";
mail($email,"Worksheet",$message, $headers);
}
else{}
$cargo变量调用不存在的输入名称"transdbrow"。
$cargo=$_POST['transdbrow']['cntr_no']['transdbrow']['no_of_cntr'];
你的代码应该是
$cargo=$_POST['cntr_no_edit_add'];
或
$cargo=$_POST['cntr_no_new'];