For now, I'm working on an users managment page.
When an admin chooses to delete a user, I did create alert and confirmation popups to be sure the actions are done.
I have a form, and 2 buttons
<td colspan="2">
<input type="submit" value="modifier" name="modifier" onclick="return sure()"> ou
<input type="submit" value="supprimer" name="supprimer" onclick="return sure2()">
</td>
and several JS functions like :
<script>
function sure(){
alert("L'utilisateur <?php echo $nom->nom ;?> <?php echo $prenom->prenom ;?> a bien été modifié.");
}
function sure2(){
var result=confirm("Etes-vous sur de vouloir supprimer <?php echo $nom->nom ;?> <?php echo $prenom->prenom ;?> ?")
if (result==true)
{
alert("Suppression effectuée")
close
window.open ("admin_modif_user.php") (to be opened in the same tab after closing the deletion page)
}
else
{
return false;
}
}
</script>
The thing I want to do is when the admin click "no" (the return false) he's redirected on the list showing the users (a certain php page), and the same for when the admin click on the last OK to aknowlege the deletion.
Hope you understand my question, it surely can be a little confusing.
Thanks in advance :)