Je n'arrive pas à trouver comment faire pour pouvoir faire dans la fonction mail() permette de joindre des pdf dans mon formulaire
<?php
if(!empty($_POST))
{
echo '<pre>'; print_r($_POST); echo '</pre>';
$boundary = md5(rand()); // clé aléatoire de limite
// entête email
$headers = 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: multipart/mixed;boundary='.$boundary.'; charset=UTF-8'."\n";
$headers .= 'Reply-To: Franck@labeo.fr'."\n";
$headers .= 'From: "' . ucfirst(substr($_POST['email'], 0, strpos($_POST['email'], '@'))) . '"<'.$_POST['email'].'>' . "\n";
$headers .= 'Delivered-to: Franck@laboratoire.fr' . "\n";
$message ="Objet : FILIATION – Commande KIT "."<br><br>". "Nom : " . $_POST['nom'] ."<br>". "Prénom : " . $_POST['prenom'] ."<br>"."Numéro d'identification : " . $_POST['identitficateur']."<br><br>"."Rue : " . $_POST['street'] ."<br>"."Code postal : " . $_POST['postal'] ."<br>"."Ville : " . $_POST['city'] ."<br>"."Email : " . $_POST['email'] ."<br>"."Téléphone portable : " . $_POST['phone'] ."<br>"."Téléphone fixe: " . $_POST['tel']."<br><br>"."Nombre de kits : "."<strong>". $_POST['number-kits']."</strong>"."<br><em>(1 Kit contient 1 sachet étanche, 1 rack compartimenté, 1 planche de 5 étiquettes)</em><br>"."<br>". "Nombres de tubes et aiguilles : "."<strong>". $_POST['number-aiguilles'] ."</strong>"."<br><em>(1 tube = aiguille)</em><br>"."<br>". "Nombres d'adaptateur : "."<strong>" . $_POST['number-adaptateur']."</strong>" ."<br><br>". "Petit carton + étiquette Chronopost Retour : "."<strong>" . $_POST['number-small'] ."</strong>"."<br><br>". "Grand carton + étiquette Chronopost retour : "."<strong>" . $_POST['number-big']."</strong>" ."<br><br>"."Commentaire : "."<br><strong>". $_POST['message']."</strong><br>" ;
mail("Gabriele.FOUIX@labeo.fr", "Objet : FILIATION – Commande KIT ", $message, $headers);
header("location:form-merci.php");
}
?>
<body>
<div class="contact container">
<div class="row mt-4 ">
<div class="col-12 text-center bg-light ">
<h1>Commande de kits génomique</h1>
<form method="post" action="" enctype="multipart/form-data">
<div class="form-row justify-content-center bg-light py-5">
<div class="form-group col-lg-3">
<label for="identity-number">Identificateur</label>
<input type="text" class="form-control" id="identitficateur" name="identitficateur" required/>
<div class="invalid-feedback">
Numéro inconnu
</div>
<div class="valid-feedback">
Numéro reconnu
</div>
</div>
<div class="form-group col-lg-5">
<label for="email">Email</label>
<input type="email" class="form-control" id="email" name="email" required/>
</div>
<div class="form-group col-lg-5">
<label for="nom">Nom</label>
<input type="text" disabled="disabled" class="form-control" id="nom" name="nom" required>
</div>
<div class="form-group col-lg-5">
<label for="prenom">Prénom</label>
<input type="text" disabled="disabled" class="form-control" id="prenom" name="prenom" required>
</div>
<div class="form-group col-lg-10">
<label for="street">Rue</label>
<input type="text" disabled="disabled" class="form-control" id="street" name="street" required/>
</div>
<div class="form-group col-lg-5">
<label for="postal">Code Postal</label>
<input type="text"disabled="disabled" class="form-control" id="postal" name="postal"maxlength="5" pattern="[0-9]{5}" title="5 chiffres" required/>
</div>
<div class="form-group col-lg-5">
<label for="city">Ville</label>
<input type="text"disabled="disabled" class="form-control" id="city" name="city" required/>
</div>
<div class="form-group col-lg-5">
<label for="phone">Teléphone Portable</label>
<input type="text" disabled="disabled" class="form-control" id="phone" name="phone" pattern="[0-9]{10}" required/>
</div>
<div class="form-group col-lg-5">
<label for="tel">Téléphone Fixe</label>
<input type="text" disabled="disabled" class="form-control" id="tel" name="tel" pattern="[0-9]{10}" />
</div>
<div class="form-group col-lg-3">
<label for="kit">Kits </label><br>
<!-- <input type="number" disabled="disabled" class="form-control" id="kit" name="kit" required/> -->
<select name="number-kits" id="number-kits" disabled="disabled" required>
<option value=""></option>
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="150">150</option>
<option value="200">200</option>
</select>
</div>
<div class="form-group col-lg-2">
<label for="aiguilles">Tubes et Aiguilles</label><br>
<!-- <input type="number" disabled="disabled" class="form-control" id="aiguilles" name="aiguilles" required/> -->
<select name="number-aiguilles" id="number-aiguilles" disabled="disabled">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="150">150</option>
<option value="200">200</option>
</select>
</div>
<div class="form-group col-lg-2">
<label for="adaptateur">Adaptateur</label><br>
<!-- <input type="number"disabled="disabled" class="form-control" id="adaptateur" name="adaptateur" required/> -->
<select name="number-adaptateur" id="number-adaptateur" disabled="disabled">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
</div>
<div class="form-group col-lg-2">
<label for="small-box">Petit carton + étiquette retour</label><br>
<!-- <input type="number" disabled="disabled" class="form-control" id="small-box" name="small-box" required/> -->
<select name="number-small" id="number-small" disabled="disabled">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
<div class="form-group col-lg-3">
<label for="big-box">Grand carton + étiquette retour</label><br>
<!-- <input type="number" disabled="disabled" class="form-control" id="big-box" name="big-box"required/> -->
<select name="number-big" id="number-big" disabled="disabled">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
<div class="form-group col-lg-10">
<label>Vos commentaires</label>
<textarea class="form-control" disabled="disabled" id="message" rows="3" name="message" ></textarea>
</div>
<div class="form-group col-lg-10">
<label> Pièce jointe </label>
<input type="file" name="fichier" id="fichier" multiple>
</div>
<div class="form-group col-lg-10 "style="display:flex">
<div class="form-group col-lg-1 ">
<input type="checkbox" class="form-control" id="rgpd" name="rgpd" required/>
</div>
<div class="form-group col-lg-8 ">
<label for="rgpd"class="rgpd"> En cochant cette case, j’accepte <a href="https://www.laboratoire-labeo.fr/fr/politique-de-confidentialite/">la Politique de confidentialité </a>de ce site </label>
</div>
</div>
<input type="submit" disabled="disabled" name="valider" id="valider" value="Valider" class="form-control btn btn-light text-dark"/>
</div>
</form>
</div>
</body>