Skip to main content
Inspiring
March 31, 2018
Question

HTML form + PHP does not match

  • March 31, 2018
  • 1 reply
  • 350 views

Hello users, I am facing difficulties in creating a form for a random website.

I am using HTML and a file in PHP for developing the same, codes below:

File PHP:

<!doctype html>

<html>

<head>

<meta http-equiv="Content-Type" content="txt/html; charset=iso-8859-1">

</head>

<body>

<?php

     $mensagem = "Nome: ".$_POST['nome']." \n";

     $mensagem = "Email: ".$_POST['email']." \n";

     $mensagem = "Assunto: ".$_POST['assunto']." \n";

     $mensagem = "Mensagem: ".$_POST['mensagem'].

     mail("helpcelere@gmail.com", "Suporte Célere", $mensagem);

?>

</body>

</html>

File HTML:

<form action="contato_file.php" method="post" enctype="multipart/form-data" name="formulario_contato" id= "formulario_contato" align="center">

    <input name="nome" type="text" id="nome" form="formulario_contato" placeholder="Nome" size="35" />

    <br />

    <input name="email" type="text" id="email" form="formulario_contato" placeholder="E-mail" size="35" />

    <br />

    <input name="assunto" type="text" id="assunto" form="formulario_contato" placeholder="Assunto" size="35" />

    <br />

    <textarea name="mensagem" cols="45" rows="5" id="mensagem" form="formulario_contato" placeholder="Digite sua mensagem"></textarea>

    <br />

    <button type="submit" form="formulario_contato" value="Enviar">Enviar</button>

  </form>

When I press the send button, it points to the "contact_file.php" page, however, the email with the filled fields of the form does not arrive in the email described "helpcelere@gmail.com".

can anybody help me? Thankful!

This topic has been closed for replies.

1 reply

BenPleysier
Community Expert
Community Expert
March 31, 2018

Have a look at PHP mail() Function

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!