I have some issue with my PHP file it's meant to put steps passed in a game on my database but when I try to submit my form it return me this error,
Parse error: syntax error, unexpected end of file in /***/**********/****/********/WWW/Page_Administrateur/InsertionEtape.php on line 31
here's my code:
<?php
include('../connexion.inc.php');
?>
<?php
if (isset($_POST["quantity"]) && $_POST["quantity"] != 0 && $_POST["quantity"] != "") {
$nbEtapes=$_POST['quantity'];
echo $nbEtapes;
for ($i=1; $i <= $nbEtapes; $i++) {
echo "etape".$i;
$DescriptionEtape=$_POST['NomEtape_'.$i];
$NomEtape=$_POST['DescriptionEtape_'.$i];
$req= "INSERT INTO `Etape` VALUES ('".$NomEtape."','".$DescriptionEtape."');";
try {
$dbh->query($req);
echo "Etape Ajouté";
} catch (\Exception $e) {
echo $e;
}
header('Refresh: 50; URL=FormulaireInsertion.php');
}
}else {
echo "aucune étapes ajouter car aucune étape n'a été entrée";
header('Refresh: 2; URL=FormulaireInsertion.php');
}
echo "done";
?>
how can I solve this ?