Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php $\u订单列表中的POST复选框。电子邮件_Php_Html_Email_Checkbox - Fatal编程技术网

Php $\u订单列表中的POST复选框。电子邮件

Php $\u订单列表中的POST复选框。电子邮件,php,html,email,checkbox,Php,Html,Email,Checkbox,所以基本上我有一个多项目的结账页面,上面有一个复选框,假设你想要15个项目中的4个,当你选中这些复选框时,这些特定的项目会被添加到发送给你邮件的订单列表中 我还没有为复选框设置一个值,因为我正在尝试解决这个问题 这是一堵文字墙,我知道。JSFIDLE对我提交的代码表现迟钝 菲律宾元邮政 $basic_standby = trim(htmlentities($_POST['basic_standby'], ENT_QUOTES)); $advanced_standby = trim(htmlent

所以基本上我有一个多项目的结账页面,上面有一个复选框,假设你想要15个项目中的4个,当你选中这些复选框时,这些特定的项目会被添加到发送给你邮件的订单列表中

我还没有为复选框设置一个值,因为我正在尝试解决这个问题

这是一堵文字墙,我知道。JSFIDLE对我提交的代码表现迟钝

菲律宾元邮政

$basic_standby = trim(htmlentities($_POST['basic_standby'], ENT_QUOTES));
$advanced_standby = trim(htmlentities($_POST['advanced_standby'], ENT_QUOTES));
$basic_game_overlay = trim(htmlentities($_POST['basic_game_overlay'], ENT_QUOTES));
$advanced_game_overlay = trim(htmlentities($_POST['advanced_game_overlay'], ENT_QUOTES));
$desktop_overlay = trim(htmlentities($_POST['desktop_overlay'], ENT_QUOTES));
$offline_overlay = trim(htmlentities($_POST['offline_overlay'], ENT_QUOTES));
$live_overlay = trim(htmlentities($_POST['live_overlay'], ENT_QUOTES));
$avatar_image = trim(htmlentities($_POST['avatar_image'], ENT_QUOTES));
$description_images = trim(htmlentities($_POST['description_images'], ENT_QUOTES));
$team_logo = trim(htmlentities($_POST['team_logo'], ENT_QUOTES));
$gold_package = trim(htmlentities($_POST['gold_package'], ENT_QUOTES));
$website_design = trim(htmlentities($_POST['website_design'], ENT_QUOTES));
邮件HTML/PHP

<table cellpadding="0" cellspacing="0" border="0" width="670" class="content">
    <tr>
        <td width="100"></td>
        <td style="padding: 5px 0 20px 0; font-size: 13px;"><b style="text-transform: uppercase; font-size: 14px;">Order list:</b><br /><br /> '. $faster_delivery .'<br /> '. $basic_standby .'<br /> '. $advanced_standby .'<br /> '. $basic_game_overlay .'<br /> '. $advanced_game_overlay .'<br /> '. $desktop_overlay .'<br /> '. $offline_overlay .'<br /> '. $live_overlay .'<br /> '. $avatar_image .'<br /> '. $description_images .'<br /> '. $team_logo .'<br /> '. $gold_package .'<br /> '. $website_design .'</td>
        <td width="100"></td>
    </tr>
</table>

编辑

当我尝试发送电子邮件时,它显示如下


我想我明白了……您将复选框的值设置为0

也就是说,如果他们被检查,发送的值将是“0”…如果你不检查他们…值将是…等待它…“0”也被视为false

您必须设置如下内容:

如果选中该框,则可以执行以下操作:

if( isset($_POST['advanced_game_overlay']) )
    $advanced_game_overlay = $_POST['advanced_game_overlay'];

然后您可以在表单中使用该变量,如果选中该框,它将显示1,如果未选中,则显示0。试试看,也许能解决问题。在您的转储文件中,我们看到值“sticka”,它被发送,因此您的表单信息被成功发送,您还可以从输入中重用“name”属性,因此除了…

您是否在处理$\u POST之前检查表单是否已发布?您确实有表单标签,对吗?定义变量并设置空值。表单和电子邮件发件人在同一个文件中,所有内容都在一个页面中。我确实有表单标签,没有指向任何地方
@dagoncon在实际尝试使用POST变量检查内部内容并发布之前,是否可以执行var\u转储($\u POST)?注释不用于扩展讨论;这段对话已经结束。
Notice: Undefined index: basic_standby in C:\xampp\htdocs\datoverlayguy\core\includes\send_order.php on line 44

Notice: Undefined variable: newsletter in C:\xampp\htdocs\datoverlayguy\core\includes\send_order.php on line 45

Notice: Undefined index: advanced_standby in C:\xampp\htdocs\datoverlayguy\core\includes\send_order.php on line 48

Notice: Undefined index: basic_game_overlay in C:\xampp\htdocs\datoverlayguy\core\includes\send_order.php on line 52

Notice: Undefined index: advanced_game_overlay in C:\xampp\htdocs\datoverlayguy\core\includes\send_order.php on line 56

Notice: Undefined index: offline_overlay in C:\xampp\htdocs\datoverlayguy\core\includes\send_order.php on line 64

Notice: Undefined index: live_overlay in C:\xampp\htdocs\datoverlayguy\core\includes\send_order.php on line 68

Notice: Undefined index: avatar_image in C:\xampp\htdocs\datoverlayguy\core\includes\send_order.php on line 72

Notice: Undefined index: description_images in C:\xampp\htdocs\datoverlayguy\core\includes\send_order.php on line 76

Notice: Undefined index: website_design in C:\xampp\htdocs\datoverlayguy\core\includes\send_order.php on line 88
if( isset($_POST['advanced_game_overlay']) )
    $advanced_game_overlay = $_POST['advanced_game_overlay'];