---
# System prepended metadata

title: PHP - Formulaire de contact (basique)
tags: [PHP]

---

![Name](https://badgen.net/badge/author/Melissa%20Galvan/blue) [![Web site](https://badgen.net/badge/website/melinweb.fr/blue)](https://melinweb.fr/) [![Gitlab](https://badgen.net/badge/gitlab/m_galvan/blue?icon=gitlab)](https://gitlab.com/iamelg) [![Github](https://badgen.net/badge/github/iamel-g/blue?icon=github)](https://github.com/iamel-g) [![Twitter](https://badgen.net/badge/twitter/iamel_g/blue?icon=twitter)](https://twitter.com/iamel_g)

# PHP - Formulaire de contact (basique)

### Un formulaire de contact :
```
// contact.php

<form action="submit_contact.php" method="GET">
    <div>
        <label for="email">Email</label>
        <input type="email" name="email">
    </div>
    <div>
        <label for="message">Votre message</label>
        <textarea type="textarea" placeholder="Exprimez vous" name="message"></textarea>
    </div>
    <button type="submit">Envoyer</button>
</form>
```

Rendu (pas terrible) :

![](https://i.imgur.com/RvngzXm.png)

<br> 

### Récupération des données du formulaire :

```
// submit_contact.php

<h1>Message bien reçu !</h1>

<div class="card">

    <div class="card-body">
        <h5 class="card-title">Rappel de vos informations</h5>
        <p class="card-text"><b>Email</b> : <?php echo $_GET['email']; ?></p>
        <p class="card-text"><b>Message</b> : <?php echo $_GET['message']; ?></p>
    </div>
</div>
```
<h3 style="text-align:center;">Youhou ! 🥳</h3> 

![](https://i.imgur.com/KItwbY0.png)

###### tags: `PHP`