I'm submitting a form in POST method which initially sends an email with the form informations.
The issue here is that when filling the email input and trying to var_dump it, all I get is string(0) "" and I can't figure out why.
Here's the form :
<form id="form" class="form" name="postuler" method="post" action="/sources/site/composants/recrutement/receive.php" enctype="multipart/form-data" novalidate>
<div style="width:auto; float:left; padding-left:15px;">
<label for="nom">Votre nom <span class="required">*</span></label>
<input type="text" class="nom" placeholder="ex: Doe" name="nom" id="nom" maxlength="40" required="required"/>
<br/>
<div class="not-hidden">
<label for="mail">Adresse e-mail <span class="required">*</span></label>
<input type="email" class="email" placeholder="ex: [email protected]" name="mail" id="email" maxlength="40" required="required"/>
</div>
<div class="hidden-fields">
<label for="prenom">Votre prénom <span class="required">*</span></label>
<input type="text" class="prenom" placeholder="ex: John" name="prenom" id="nom" maxlength="40" required="required"/>
</div>
</div>
<div style="width:auto; float:left; padding-left:15px">
<div class="not-hidden">
<label for="prenom">Votre prénom <span class="required">*</span></label>
<input type="text" class="prenom" placeholder="ex: John" name="prenom" id="nom" maxlength="40" required="required"/>
</div>
<div class="hidden-fields">
<label for="mail">Adresse e-mail <span class="required">*</span></label>
<input type="email" class="email" placeholder="ex: [email protected]" name="mail" id="email" maxlength="40" required="required"/>
</div>
<input type="submit" name="upload" id="envoyez" value="Valider" class="postu"/>
</form>
I tried to debug the mail variable with :
if(isset($_POST['mail'])){
var_dump($_POST['mail']);
} else {
echo 'Did not receive var, sorry';
}
name="mail"and it'll just pick the last one, as it overwrites the other.