I wanna received my form contact on my email address.
i have my form on my index.html
<form id="contact" action="index.php" method="post">
<div class="row">
<div class="col-lg-4 col-md-12 col-sm-12">
<fieldset>
<input
name="name"
type="text"
class="form-control"
id="name"
placeholder="Nom complet"
required=""
/>
</fieldset>
</div>
<div class="col-lg-4 col-md-12 col-sm-12">
<fieldset>
<input
name="email"
type="text"
class="form-control"
id="email"
pattern="[^ @]*@[^ @]*"
placeholder="Adresse email"
required=""
/>
</fieldset>
</div>
<div class="col-lg-4 col-md-12 col-sm-12">
<fieldset>
<input
name="subject"
type="text"
class="form-control"
id="subject"
placeholder="Objet"
required=""
/>
</fieldset>
</div>
<div class="col-lg-12">
<fieldset>
<textarea
name="message"
rows="6"
class="form-control"
id="message"
placeholder="Votre demande"
required=""
></textarea>
</fieldset>
</div>
<div class="col-lg-12">
<fieldset>
<button
type="submit"
id="form-submit"
class="border-button"
>
Envoyer
</button>
</fieldset>
</div>
</div>
</form>
then i create my index.php and i write what i want to receip
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Envoi d'un message par formulaire</title>
</head>
<body>
<?php
if(isset($_POST['submit'])){
$to = "wendymontagnon@gmail.com"; // this is your Email address
$from = $_POST['email']; // this is the sender's Email address
$name = $_POST['name'];
$subject = $_POST['subject'];
$message = $name . " souhaite vous contacter:" . "\n\n" . $_POST['message'];
$headers = "From:" . $from;
$headers2 = "From:" . $to;
mail($to,$subject,$message,$headers);
mail($from,$subject2,$message2,$headers2); // sends a copy of the message to the sender
echo "<p>Votre message a bien été envoyé.</p>";
// You can also use header('Location: thank_you.php'); to redirect to another page.
} else{
echo "<p> ça marche pas </p>";
}
?>
</body>
</html>
i'm also connected to mamp , i open my website by mamp, when i click on my submit button i'm redirected to index.php. but i have white page and i don't get the "echo"