I want to give the admin the ability to activate the user account so I have to status active and inactive When I run my code I get 4 status Active Inactive Active Inactive You will find here a screenshot to understand the problem I’m facing
https://i.stack.imgur.com/UBNOQ.png
if(isset($_GET['id_user'])){
include("conexion.php");
$rep=$db->query("select * from user WHERE id_user=" .$_GET['id_user'] );
while($l=$rep->fetch()){
echo "
<form class= mainSettingsForm add method='POST'>
<label>Numero utlisateur :</label>
<input disabled='disabled' type='text' name='ref' value=' ".$l[0]." ' ></input>
<input name='id_user2' type='hidden' value='".$l[0]."' ></input>
<label>Nom utlisateur : </label>
<input type='text' name='username2' value='".$l[1]."' >
<label> nom : </label>
<input type='text' name='nom2' value='".$l[3]."' >
<label> prenom : </label>
<input type='text' name='prenom2' value='".$l[4]."' >
<label> Statut : </label>
<select name=statut >
if ($l[6] ==active) {
echo '
<option value=active >active</option>
<option value=inactive >inactive</option> }'
else {
echo '
<option value=inactive >inactive</option>
<option value=active >active</option> }'
</select>
<input class=btn-primary type='submit' name='enregistrer' value='enregistrer' >
</form>"; // fin echo
}
}
?>