IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

button de confirmation


Sujet :

PHP & Base de données

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre actif
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2011
    Messages
    65
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Avril 2011
    Messages : 65
    Par défaut button de confirmation
    Bonjours,

    SVP ,qui peut m'aider, j'ai un script php et je voudrai lorsque j'appuis sur le boutton "supprimer" ou "signaler rebu", il m 'apparaitre une fenetre de confirmation
    voici le code et merci d'avance
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    <?php
    session_start();
    include("connexion.php");
    connect($host,$user,$mot_passe,$db_name);
    if ( !session_is_registered("authen_user")){
    #echo '<META HTTP-EQUIV="refresh" CONTENT="0;URL=index.php?erreur=404">';
    #redirection instantanée
    header("location:index.php?erreur=404");
    }
    ?>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <link href="css/style.css" rel="stylesheet">
    <title></title>
    </head>
    <body topmargin="0" leftmargin="0">
    &nbsp;
    <table width="1100" height="902"  border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111" bgcolor="#FFFFFF" style="border-collapse: collapse">
    <tr>
        <td width="100%" height="126" align="left" valign="top">
             <table WIDTH="1100" BORDER="0" CELLPADDING="0" CELLSPACING="0">
                <tr>
                    <td COLSPAN="6"><img SRC="img/header.jpg" WIDTH="387" HEIGHT="94"></td>
               </tr>
    	       <tr>
                 <td width="89"><a class="linx" href="user_home.php">Consultation  </a></td>
                    <td width="111"><a class="linx" href="new.php">Ajouter nouveau</a></td>
                    <td width="80"><a class="linx" href="find.php">Recherche</a></td>
                 <td width="425"><a class="linx" href="mail.php">Exportation Excel</a></td>
                   <td width="175"><a class="linx" href="#6"></a></td>
                   <td width="87"><a class="linx" href="deco.php">D&eacute;connecxion</a></td>
              </tr>
    		  <tr>
    		    <td COLSPAN="6">&nbsp;</td>
    		   </tr>
          </table>
        </td>
    </tr>
    <tr>
         <td  valign="top"><hr>
    	 <table width="1100"  BORDER="1" bordercolor="#BDE7F7" CELLPADDING="0" CELLSPACING="0">
    	   <tr>
    	     <th width="39"><p align="left" class=text2>N&deg;</th><th width="108"><p align="left" class=text2>N&deg; de s&eacute;rie</th><th width="122" ><p align="left" class=text2>N&deg;d'immo</th><th width="121" ><p align="left" class=text2>Date de  r&eacute;ception</th><th width="93"><p align="left" class=text2>statut affectation</th><th width="95"><p align="left" class=text2>statut Pc</th><th width="228"><p align="left" class=text2><strong>b&eacute;n&eacute;ficiaire</strong></th><th width="121"><p align="left" class=text2>Modifier  statut Affectation</th><th width="153"><p align="left" class=text2>Modifier  statut pc</th>
    	   </tr>
    	   <?php
    	   $sql="select * from pc";
    	   $rs=mysql_query("$sql");
    	   $i=1;
    	   while($tab=mysql_fetch_array($rs))
    	   { 
     
    	     echo "<tr>";
    		 echo "<td valign=top><p class=text2>$i</td>";
    	     echo "<td valign=top><p class=text2>$tab[1]</td>";
    		 echo "<td valign=top><p class=text2>$tab[2]</td>";
    		 echo "<td valign=top><p class=text2>$tab[9]</td>";
    		 echo "<td valign=top><p class=text2>$tab[7]</td>";
    		 echo "<td valign=top><p class=text2>$tab[8]</td>";
    		 echo "<td><p class=text2><img src=img/arrow1.gif border=0> Nom :$tab[3]<br>
    		 <img src=img/arrow1.gif border=0> Pr&eacute;nom :$tab[4]<br> 
    		 <img src=img/arrow1.gif border=0> N°Command :$tab[11]<br> <img src=img/arrow1.gif border=0> matricule :$tab[5] <br> <img src=img/arrow1.gif border=0> Service/UF :$tab[6]<br><img src=img/arrow1.gif border=0> Date d'affectation :$tab[10]
    		 </td>";
    		 echo "<td valign=top><p class=text2>
    		 <a class=linx href=affect.php?id=$tab[0]>Affecter</a><br>
    		 <a class=linx href=update.php?id=$tab[0]>Signaler Libre</a><br>
    		 <a class=linx href=delet.php?id=$tab[0]>Supprimer</a><br>
    		 </td>";
     
    		 echo "<td valign=top><p class=text2>
    		 <a class=linx href=update3.php?id=$tab[0]>Signaler fonctionnel</a><br>
    		 <a class=linx href=updat4.php?id=$tab[0]>Signaler en reparation</a><br>
    		 <a class=linx href=update2.php?id=$tab[0]>Signaler rebut</a><br>
    		 
    		 </td>";
    	     echo "</tr>";
    		 $i++;
    		 function confirm(){
               $question = 'Etes-vous sur de vouloir supprimer  ' ;
             $confirmation = confirm($question) ;
     
                if($confirmation = true){
              return true;
       }
       <?php
    		  while ($tab[7]="supprimer" £tab[8]="signaler rebut"){
       ?>
    		<INPUT TYPE="button" ONCLICK="if ( confirm('vous êtes sûr ?') ) location.href='../../index.php';"NAME="submit2" VALUE="confirmer" />
    		}
    	<?php
    	   }
    	 ?>
    	   ?>
     
    	 </table>
     
        </td>	   
    </tr>
    </table>
    </body>
    </html>

  2. #2
    Membre confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Avril 2009
    Messages
    76
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2009
    Messages : 76
    Par défaut
    Pour une boîte de dialogue, utilise le javascript

  3. #3
    Membre éclairé
    Homme Profil pro
    Inscrit en
    Avril 2011
    Messages
    660
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Avril 2011
    Messages : 660
    Par défaut
    Citation Envoyé par pfakhmaies Voir le message
    Bonjours,

    SVP ,qui peut m'aider, j'ai un script php et je voudrai lorsque j'appuis sur le boutton "supprimer" ou "signaler rebu", il m 'apparaitre une fenetre de confirmation
    voici le code et merci d'avance
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    <?php
    session_start();
    include("connexion.php");
    connect($host,$user,$mot_passe,$db_name);
    if ( !session_is_registered("authen_user")){
    #echo '<META HTTP-EQUIV="refresh" CONTENT="0;URL=index.php?erreur=404">';
    #redirection instantanée
    header("location:index.php?erreur=404");
    }
    ?>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <link href="css/style.css" rel="stylesheet">
    <title></title>
    </head>
    <body topmargin="0" leftmargin="0">
    &nbsp;
    <table width="1100" height="902"  border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111" bgcolor="#FFFFFF" style="border-collapse: collapse">
    <tr>
        <td width="100%" height="126" align="left" valign="top">
             <table WIDTH="1100" BORDER="0" CELLPADDING="0" CELLSPACING="0">
                <tr>
                    <td COLSPAN="6"><img SRC="img/header.jpg" WIDTH="387" HEIGHT="94"></td>
               </tr>
    	       <tr>
                 <td width="89"><a class="linx" href="user_home.php">Consultation  </a></td>
                    <td width="111"><a class="linx" href="new.php">Ajouter nouveau</a></td>
                    <td width="80"><a class="linx" href="find.php">Recherche</a></td>
                 <td width="425"><a class="linx" href="mail.php">Exportation Excel</a></td>
                   <td width="175"><a class="linx" href="#6"></a></td>
                   <td width="87"><a class="linx" href="deco.php">D&eacute;connecxion</a></td>
              </tr>
    		  <tr>
    		    <td COLSPAN="6">&nbsp;</td>
    		   </tr>
          </table>
        </td>
    </tr>
    <tr>
         <td  valign="top"><hr>
    	 <table width="1100"  BORDER="1" bordercolor="#BDE7F7" CELLPADDING="0" CELLSPACING="0">
    	   <tr>
    	     <th width="39"><p align="left" class=text2>N&deg;</th><th width="108"><p align="left" class=text2>N&deg; de s&eacute;rie</th><th width="122" ><p align="left" class=text2>N&deg;d'immo</th><th width="121" ><p align="left" class=text2>Date de  r&eacute;ception</th><th width="93"><p align="left" class=text2>statut affectation</th><th width="95"><p align="left" class=text2>statut Pc</th><th width="228"><p align="left" class=text2><strong>b&eacute;n&eacute;ficiaire</strong></th><th width="121"><p align="left" class=text2>Modifier  statut Affectation</th><th width="153"><p align="left" class=text2>Modifier  statut pc</th>
    	   </tr>
    	   <?php
    	   $sql="select * from pc";
    	   $rs=mysql_query("$sql");
    	   $i=1;
    	   while($tab=mysql_fetch_array($rs))
    	   { 
     
    	     echo "<tr>";
    		 echo "<td valign=top><p class=text2>$i</td>";
    	     echo "<td valign=top><p class=text2>$tab[1]</td>";
    		 echo "<td valign=top><p class=text2>$tab[2]</td>";
    		 echo "<td valign=top><p class=text2>$tab[9]</td>";
    		 echo "<td valign=top><p class=text2>$tab[7]</td>";
    		 echo "<td valign=top><p class=text2>$tab[8]</td>";
    		 echo "<td><p class=text2><img src=img/arrow1.gif border=0> Nom :$tab[3]<br>
    		 <img src=img/arrow1.gif border=0> Pr&eacute;nom :$tab[4]<br> 
    		 <img src=img/arrow1.gif border=0> N°Command :$tab[11]<br> <img src=img/arrow1.gif border=0> matricule :$tab[5] <br> <img src=img/arrow1.gif border=0> Service/UF :$tab[6]<br><img src=img/arrow1.gif border=0> Date d'affectation :$tab[10]
    		 </td>";
    		 echo "<td valign=top><p class=text2>
    		 <a class=linx href=affect.php?id=$tab[0]>Affecter</a><br>
    		 <a class=linx href=update.php?id=$tab[0]>Signaler Libre</a><br>
    		 <a class=linx href=delet.php?id=$tab[0]>Supprimer</a><br>
    		 </td>";
     
    		 echo "<td valign=top><p class=text2>
    		 <a class=linx href=update3.php?id=$tab[0]>Signaler fonctionnel</a><br>
    		 <a class=linx href=updat4.php?id=$tab[0]>Signaler en reparation</a><br>
    		 <a class=linx href=update2.php?id=$tab[0]>Signaler rebut</a><br>
    		 
    		 </td>";
    	     echo "</tr>";
    		 $i++;
    		 function confirm(){
               $question = 'Etes-vous sur de vouloir supprimer  ' ;
             $confirmation = confirm($question) ;
     
                if($confirmation = true){
              return true;
       }
       <?php
    		  while ($tab[7]="supprimer" £tab[8]="signaler rebut"){
       ?>
    		<INPUT TYPE="button" ONCLICK="if ( confirm('vous êtes sûr ?') ) location.href='../../index.php';"NAME="submit2" VALUE="confirmer" />
    		}
    	<?php
    	   }
    	 ?>
    	   ?>
     
    	 </table>
     
        </td>	   
    </tr>
    </table>
    </body>
    </html>
    Salut,

    Tu devrais mettre ton code dans la balise code.

    Ensuite, pour la confirmation, il s'agit de javascript. Fait une recherche avec la commande javascript return confirm('')

    Bonne chance

Discussions similaires

  1. Réponses: 3
    Dernier message: 13/12/2011, 14h24
  2. Problème ajax confirm button extender dans repeater
    Par polux31 dans le forum ASP.NET
    Réponses: 2
    Dernier message: 05/04/2011, 12h34
  3. ShowMessage avec button de confirmation. Possible ?
    Par bullrot dans le forum C++Builder
    Réponses: 4
    Dernier message: 24/11/2007, 13h29
  4. Confirmation de supression d'enregistrement
    Par Lux interior dans le forum XMLRAD
    Réponses: 3
    Dernier message: 25/04/2003, 16h01
  5. [Kylix] Demande de confirmation Kylix Delphi
    Par mailstef dans le forum EDI
    Réponses: 3
    Dernier message: 21/10/2002, 10h17

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo