Hello I work with WordPress , and I create a custom Modal with form to add a Group called 'abonnement' I added the table in Database and this is my issue:
Form
<form name="abonnementCreate" action="create.php" method="POST">
<div class="form-group">
<label>Nom de l'abonnemnt</label>
<input type="text" class="form-control" id="nomA" name="nomA">
</div>
<div class="form-group">
<label>Durée</label>
<input type="number" class="form-control" id="dureeA">
<small id="dureeHelp" class="form-text text-muted">En jours</small>
</div>
<div class="form-group">
<label>Nombre de produit autorisé</label>
<input type="number" class="form-control" id="nbProdA">
</div>
<div class="form-group">
<label>Frais d'abonnement (€)</label>
<input type="number" class="form-control" id="fraisA">
</div>
<button type="submit" name="create" class="btn btn-primary">Valider</button>
</form>
and this is the action of the creation :
create.php
<?php
include'admin.php';
global $wpdb;
if(isset( $_POST["create"]))
{
$wpdb->insert('abonnement', array(
'nom' => '.$_POST["nomA"].',
'duree' => '.$_POST["dureeA"].',
'nbProd' => '.$_POST["nbProdA"].',
'frais' => '.$_POST["fraisA"].'
));
}
?>
I have $_POST["create"] and the condition is true but $_POST[" any field"] is always null,
Someone please can help me ?