I'm trying to make a form that mails the information to me. Here's my code.
PHP:
$to = "mosescu_b@yahoo.com";
$subject = "Comanda de Magneti";
$name = $_POST["nume"] . $_POST["prenume"];
$email = $_POST["email"];
$phone = $_POST["telefon"];
$adress = $_POST["adresa"];
$message = <<<EMAIL
Comanda de Magneti de la $name
Adresa de E-mail este $email
Numarul de telefon este $phone
Adresa este $adress
EMAIL;
$header ="$email";
if($_POST){
mail($to, $subject, $message, $header);
$feedback = "Multumesc pentru comanda!"
}
HTML
<div class="form-group">
<form style="font-size: 1.25em; margin-left: 20px;" method="post" action="#">
<label for="nume">Nume<span style="color: red;">*</span></label> <input name="nume" id="nume" class="form-control" type="text" placeholder="Nume" title="nume">
<label for="prenume">Prenume<span style="color: red;">*</span></label> <input name="prenume" id="prenume" class="form-control" type="text" placeholder="Prenume" title="prenume">
<label for="email">E-Mail</label><span style="color: red;">*</span><input name="email" id="email" class="form-control" type="email" placeholder="E-Mail" title="email">
<label for="telefon">Numar Telefon</label><input name="telefon" id="telefon" class="form-control" type="number" placeholder="Numar Telefon" title="telefon">
<label for="adresa">Adresa</label><span style="color: red;">*</span><input name="adresa" id="adresa" class="form-control" type="text" placeholder="Strada/Numar/Localitate/Judet" title="adresa"> <br />
<input name="submit" class="btn-default" type="submit" value="Comanda!"></input>
</form>
<p id="feedback"><?php echo $feedback ?> </p>
</div>
The error I'm getting is :"Parse error: syntax error, unexpected '}' in C:\wamp64\www\Test\comanda-magneti.php on line 30"
Which is weird, since I'm very sure that the code wouldn't run properly without the curly bracket.