Php 未发送包含图像和阵列的电子邮件

Php 未发送包含图像和阵列的电子邮件,php,forms,Php,Forms,晚上好(至少在巴西这里) 我有一个带有一些复选框和图像文件输入的表单,但当我提交它时,什么也没有发生 有什么不对劲吗 表格: <form class="form" enctype="multipart/form-data" method="post" action="envia_email.php"> <fieldset> <fieldset class="grupo"> <div c

晚上好(至少在巴西这里)

我有一个带有一些复选框和图像文件输入的表单,但当我提交它时,什么也没有发生

有什么不对劲吗

表格:

    <form class="form" enctype="multipart/form-data" method="post" action="envia_email.php">
           <fieldset>
        <fieldset class="grupo">
            <div class="campo">
                <label for="nome" id="nome">Nome Completo</label>
                <input type="text" id="nome" name="nome" style="width: 10em" value="" />
            </div>
        </fieldset>
        <div class="campo">
            <label for="email">E-mail</label>
            <input type="text" id="email" name="email" style="width: 13em" value="" />
        </div>
            <div class="campo">
                <label for="email">Local</label>
                <input type="text" id="local" name="local" style="width: 13em" value="" />
            </div>
        <div class="campo">
            <label for="telefone">Telefone</label>
            <input type="text" id="telefone" name="telefone" style="width: 13em"  value="" />
        </div>
               <input TYPE="checkbox" NAME="whatsapp" VALUE="Whatsapp"> Whatsapp <br><br>
        <div class="campo">
            <label for="idade">Idade</label>
            <input type="text" id="Idade" name="idade" style="width: 3em"  value="" />
        </div>
        <div class="campo">
            <label for="cache">Cachê</label>
            <input type="text" id="cache" name="cache" style="width: 10em"  value="" />
        </div>
        <div class="campo">
            <label for="cache">Atendimento</label>
            <input TYPE="checkbox" NAME="atendimento[]" VALUE="Hotéis e Motéis"> Hotéis e Motéis <br><br>
            <input TYPE="checkbox" NAME="atendimento[]" VALUE="Residência"> Residência <br><br>
            <input TYPE="checkbox" NAME="atendimento[]" VALUE="Local Próprio"> Local Próprio <br><br>
        </div>
        <div class="campo">
            <label for="cache">Atendo</label>
            <input TYPE="checkbox" NAME="atendo[]" VALUE="Homens"> Homens <br><br>
            <input TYPE="checkbox" NAME="atendo[]" VALUE="Mulheres"> Mulheres <br><br>
            <input TYPE="checkbox" NAME="atendo[]" VALUE="Casais"> Casais <br><br>
        </div>
        <div class="campo">
            <label for="cache">Formas de pagamento</label>
            <input TYPE="checkbox" NAME="pagamento[]" VALUE="Dinheiro"> Dinheiro <br><br>
            <input TYPE="checkbox" NAME="pagamento[]" VALUE="Cheque"> Cheque <br><br>
            <input TYPE="checkbox" NAME="pagamento[]" VALUE="Cartão"> Cartão <br><br>
        </div>
        <div class="campo">
            <label for="mensagem">Atendimento e serviços</label>
            <textarea rows="6" style="width: 15em" id="mensagem" name="mensagem"></textarea>
        </div>
        <div class="campo">
            <label for="img">Imagem 1</label>
            <input type="file" name="imagem[]" style="width: 10em" />
        </div>
        <div class="campo">
            <label for="img">Imagem 2</label>
            <input type="file" name="imagem[]" style="width: 10em"  />
        </div>
        <div class="campo">
            <label for="img">Imagem 3</label>
            <input type="file" name="imagem[]" style="width: 10em"  />
        </div>
        <div class="campo">
            <label for="img">Imagem 4</label>
            <input type="file" name="imagem[]" style="width: 10em"  />
        </div> 
        <div class="campo">
            <label for="img">Imagem 5</label>
            <input type="file" name="imagem[]" style="width: 10em"  />
        </div>
        <div class="campo">
            <label for="img">Imagem 6</label>
            <input type="file" name="imagem[]" style="width: 10em"  />
        </div>
        <div class="campo">
            <label for="img">Imagem 7</label>
            <input type="file" name="imagem[]" style="width: 10em"  />
        </div>
        <div class="campo">
            <label for="img">Imagem 8</label>
            <input type="file" name="imagem[]" style="width: 10em"  />
        </div>
        <button type="submit" name="enviar">Enviar</button>

     </fieldset>
</form>

诺姆Completo
电子邮件
地方的
电传
Whatsapp

伊达德 卡什 阿坦迪门托 热是热,不是热

恩西亚公寓

当地普罗普里奥

阿滕多 霍姆斯

多处

Casais

帕加门托形式酒店 迪涅罗

支票 卡托昂

阿滕迪门托酒店 图像M 1 图像M 2 图像3 图像M 4 图像M 5 图像6 图像7 图像8 羡慕
PHP


我问了一些朋友,他们都说没关系,但还是不行。救命啊


问候。

我在您的PHP代码中发现了一个问题。您已经编写了

if(file_exists($Imagem['tmp_name'])) and !empty($Imagem) {
但应该是这样的

if(file_exists($Imagem['tmp_name']) && !empty($Imagem))    {

我在php代码中发现的另一个问题是

$whatspapp = $_POST['whatsapp'];
但在另一个地方,您使用了
if($whatsapp!=''){


尝试调试更多错误

什么不起作用?@Dekel正如我所写,当我提交时,什么都没有发生。可能我的PHP是这里的坏人…你没有在这个页面上输出任何东西。
echo
print
,或者离开PHP并输出一些东西。还可以启用错误报告并检查日志。当你说“什么都没发生”意味着应该发生什么。应该发生什么?@Dekel它应该发送一封包含表单信息的电子邮件。我正在使用邮件()我的php文件最后一行中的php函数。嘿!它几乎完全工作了。只是附件没有工作。知道为什么吗?不,我想让live post数据看看文件数据是否真的被发送到服务器。同时验证foreach($imagem as$imagem){if(file_存在($imagem['tmp_name'])和!empty($imagem)的代码{…因为这些代码处理您的attachment@GabrielSilva您可以在浏览器控制台中进行检查,或者使用xdebug获取操作中的post数据,以验证是否从客户端正确发送了所有内容
if(file_exists($Imagem['tmp_name']) and !empty($Imagem))    {
$whatspapp = $_POST['whatsapp'];