0

I'm having difficulty to make this simple form work. I have this code in HTML:

 <form method = "post" action = "ackowledge.php"> 
      <label for="usr">Endereço de e-mail:</label>
      <input type="text" class="form-control" id="formulario" name = "inputbox" placeholder = "Insira aqui o seu endereço de e-mail">
      <input type = "submit" name = "enviar" value = "Enviar mensagem">
      </form>

And I have this code, which I called acknowledge.php:

<?php
if (isset($_POST['enviar'])){

    $to = "lucaslealaraujo@gmail.com";
    $subject = "Envio de formulário de voluntárix"

    $message .= 'nome: ' . $_POST['enviar'] . "\r\n\r\n";
    echo $message;
}
?>

<h1> Obrigado por entrar em contato!</h1>
<p>  O seu e-mail foi enviado e nós entraremos em contato com você em breve. :) </p>
<h1> Ops! </h1>
<p> Algo deu errado. Por favor, tente de novo. </p>

(Texts and paragraphs in portuguese, if you are wondering) I'm having some difficulty to understand why I'm not being able to make this form work. In the tutorial I'm following, I think the site was supposed to open a page with the h1s and the ps that are on the php code, but it isn't working. Can you guys help me out?

By the way, I have some experience in HTML, but this is literally the first PHP code I write.

Lucas Leal
  • 245
  • 1
  • 2
  • 8

0 Answers0