Bonjour,

J'ai créé un tableau avec des "input" (Submit et Submit2) pour renvoyer vers une autre page (modifier une fiche) ou tout simplement supprimer un élément dans la DB.

A la base tout marchait, je suis revenu plusieurs mois plus tard sur mon code et le bouton n'a aucun effet. Cela se fait sur tous mes tableaux.
J'ai donc inséré ce code pour tracer le problème :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
print "<script>alert();</script>";
et à première vue la boite de dialogue ne s'affiche pas.

Voici ma page code.
Si quelqu'une trouve ou me met sur la piste, ce serait super sympa. Merci

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
 <?php
 include 'menuhead.php';
 ?>
 
 
	<div class="col-lg-12 text-center">
	  <h2>Nutzer</h2>
	</div>
 
	<form id="form1" name="form1" method="post">
 
      <table width="300" border="0" align="center">
 
<td>Nachname oder Vorname des Nutzers:</td>
 
      <td><input type="text" name="t1" id="t1" size="19" style="width:170px;"></td>
	  <td><input name="b2" type="submit" id="b2" value="Suchen">&nbsp;&nbsp;&nbsp;&nbsp;<input name="b3" type="submit" id="b3" value="Neu"></td>
</tr>
  </table>
  <br>
  <?php
  if(isset ($_POST['b2']) OR isset ($_POST['submit']))
 {
 
  ?>
 	<table width="700" border="2" align="center" class="table-style-two">
	  <tbody>
	    <tr>
          <th><b>Nutzer</b></th>
	      <th><b>Nachname</b></th>
		  <th><b>Vorname</b></th>
		  <th><b>Profil</b></th>
          <th  width=50></th>
		  <th  width=50></th>
        </tr>
 
 <?php
 }
 
 if(isset ($_POST['submit']))
 { 
$dr=mysql_query("DELETE FROM users WHERE Login='".addslashes($_POST['submit'])."'");
 }
 
  if(isset ($_POST['submit2']))
 { 
print "<script>alert();</script>";
$_SESSION['i']="0";
$_SESSION['submit2']=addslashes($_POST['submit2']);
print "<script>window.location='user2.php';</script>";
 }
  if(isset ($_POST['b3']))
 { 
$_SESSION['submit2']='';
$_SESSION['i']="1";
 }
 
  if(isset ($_POST['b2']) OR isset ($_POST['submit']))
 {
 $dr=mysql_query("SELECT u.login, u.nom, u.prenom, t.name  FROM users u, usertype t WHERE u.Prof=t.code AND concat(nom, ' ', prenom) like '%".addslashes($_POST['t1'])."%'");
 while($ligne=mysql_fetch_array($dr))
 {
 ?>
	    <tr>
	      <td><?php  echo addslashes ($ligne[0]); ?></td>
	      <td><?php  echo addslashes ($ligne[1]); ?></td>
		  <td><?php  echo addslashes ($ligne[2]); ?></td>
		  <td><?php  echo addslashes ($ligne[3]); ?></td>
		  <td width=50> &nbsp;&nbsp;<input type="image" name="submit2" src="img/b_search.png" value="<?php echo $ligne[0]; ?>" /></td>
          <td width=50> &nbsp;&nbsp;<input type="image" name="submit" src="img/b_drop.png" value="<?php echo $ligne[0]; ?>" /></td>
        </tr>
 
<?php
 }
echo '</tbody>';
echo '</table>';
 }
?>
</form>
 
 
 
 <?php
 include 'menubottom.php';
 ?>