Précédent   Forum des professionnels en informatique > PHP > Langage > Formulaires
Formulaires Forum d'entraide sur les formulaires avec PHP. Avant de poster -> FAQ formulaires, Cours de formulaires et Sources de formulaires
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 25/07/2011, 15h10   #1
Invité de passage
 
Inscription : janvier 2010
Messages : 22
Détails du profil
Informations forums :
Inscription : janvier 2010
Messages : 22
Points : 2
Points : 2
Par défaut Problème d'affichage recherche avec checkbox

Bonjour, voilà je suis sur un problème que je n'arrive pas à résoudre,

je souhaite afficher grâce à un formulaire donner l'élément à rechercher ainsi une validation par checkbox pour activer la fonction et donc afficher les information nécessaires.

Je vous montre le code
Code :
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
 
<html>
<center>
<br></br>
<form method="POST" action=""> 
Marteau : <input type="text" name="Marteautest">
<br></br>
<input type="checkbox" name="magasin" id="magasin"/>verifier magasin</br>
<input type="checkbox" name="stock" id="stock"/>verifier stock</br>
<input type="SUBMIT" value="Recherche"> 
</center>
<br></br>
 
<?php
if (isset($_POST['magasin']))	
{
?>
	<center>
	<font face="Verdana" size="1">
	</font>
 
	<table border="0" cellpadding="0" cellspacing="0" width="80%" id="table1">
	  <tr>
 
	  	<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Peinture</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Perceuse</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Vis</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Planche</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Marteau</font></b></td>
 
	  </tr>
	</center>
<?php
include('../user_verif.php');
 
    $Marteautest = isset($_POST['Marteautest']) ? $_POST['Marteautest'] : '';
 
	//Connexion à la Base de donnée
 
	$sql->open();
 
	//Requête SQL
 
	$result = $sql->query("Select * From Magasin Where Marteau = '$Marteautest' order by Marque ASC");
 
	//Extraction et traitement
 
	while( $row = mysql_fetch_array( $result ) )
	{
 
		$Peinture = nl2br ( $row['Peinture '] );
 
		$Perceuse = nl2br ( $row['Perceuse '] );
 
		$Vis= nl2br ( $row['Vis'] );
 
		$Planche= nl2br ( $row['Planche'] );
 
		$Marteau= nl2br ( $row['Marteau'] );
 
	    echo '<center><tr>
		<td  align="center" style="border-left: 1px solid #000000; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Peinture.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Perceuse.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Vis.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Planche.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-right: 1px solid #000000; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Marteau.'</font></td>
 
	</tr></center>';
 
	}
 
//Fin du tableau
 
?>
	<center>
	  <tr>
		<td style="border-left: 1px solid #000000; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-right: 1px solid #000000; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
	  </tr>
	</table>
	</center>
	</div>
 
  </body>
 
  </html>
 
<?php
 
  //On ferme la connexion SQL
 
  $sql->close();
 
  exit;
 
?>
}
 
<?php
if (isset($_POST['stock']))	
{	
?>
	<font face="Verdana" size="1">
	</font>
	<center>
	<table border="0" cellpadding="0" cellspacing="0" width="80%" id="table1">
	  <tr>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Planche</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Marteau</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Clou</font></b></td>
	  </tr>
	</center>
</form>
</html>	  
 
<?php
include('../user_verif.php');
 
    $BAStest = isset($_POST['Marteautest']) ? $_POST['Marteautest'] : '';
 
	//Connexion à la Base de donnée
 
	$sql->open();
 
	//Requête SQL
 
	$result = $sql->query("Select * From stock Where marteau = '$Marteautest' and order by Marque ASC");
 
	//Extraction et traitement
 
	while( $row = mysql_fetch_array( $result ) )
	{
		  $Planche= nl2br ( $row['Planche'] );
 
		  $Marteau= nl2br ( $row['Marteau'] );
 
		  $Clou= nl2br ( $row['Clou'] );
 
	    echo '<tr><center>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Planche.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Marteau.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Clou.'</font></td>
		</center>
	</tr>';
 
	}
 
//Fin du tableau
 
?>
	<center>
	  <tr>
		<td style="border-left: 1px solid #000000; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-right: 1px solid #000000; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
	  </tr>
	</table>
	</center>
	</div>
 
  </body>
 
  </html>
 
<?php
 
  //On ferme la connexion SQL
 
  $sql->close();
 
  exit;
?>	
}
Atchoum89 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 25/07/2011, 16h51   #2
Membre confirmé
 
Avatar de Retrokiller069
 
Homme Bertrand
Étudiant
Inscription : octobre 2010
Messages : 216
Détails du profil
Informations personnelles :
Nom : Homme Bertrand
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : octobre 2010
Messages : 216
Points : 268
Points : 268
Bonjour,

je suis un chiant je le reconnais avec ca mais peux tu remplacer <? par <?php car j'ai vu que tu le faisais par endroit mais pas partout.

Est ce que c'est normal que ton action ne soit pas renseigner (dans ton form), normalement il comporte l'accés vers la page suivante?

ici je dirais au vue de ton code que c'est le nom de ta page ^^
__________________
Ce n'est pas ce que nous voulons faire qui est impossible mais ce sont les moyens à sa mise en oeuvre qui peuvent le paraître

Ps: N'oubliez pas SVP
Retrokiller069 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 25/07/2011, 17h35   #3
Invité de passage
 
Inscription : janvier 2010
Messages : 22
Détails du profil
Informations forums :
Inscription : janvier 2010
Messages : 22
Points : 2
Points : 2
Bonjour Retrokiller069,

Je viens de mettre à jour les deux champs <? par <?php

Disons que pour le moment je faisais le test en interne de la page donc j'ai pas référencer la nouvelle page vu que c'est la même. (Après c'est peut-être une faute ?)
Atchoum89 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/07/2011, 08h23   #4
Membre confirmé
 
Avatar de Retrokiller069
 
Homme Bertrand
Étudiant
Inscription : octobre 2010
Messages : 216
Détails du profil
Informations personnelles :
Nom : Homme Bertrand
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : octobre 2010
Messages : 216
Points : 268
Points : 268
Bonjour,

oui c'est une erreur car en fait si le form n'a pas d'action dans ce cas il ne va nul part mais ne réactualise pas la page non plus puisqu'on lui dit pas.

tu dois juste mettre le nom de page sur laquelle tu veux aller même si c'est la même page.
__________________
Ce n'est pas ce que nous voulons faire qui est impossible mais ce sont les moyens à sa mise en oeuvre qui peuvent le paraître

Ps: N'oubliez pas SVP
Retrokiller069 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/07/2011, 09h06   #5
Invité de passage
 
Inscription : janvier 2010
Messages : 22
Détails du profil
Informations forums :
Inscription : janvier 2010
Messages : 22
Points : 2
Points : 2
Cela change rien au problème il garde toujours la première partie du code et n'affiche pas la deuxième partie quoi qu'il arrive
Atchoum89 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/07/2011, 09h20   #6
Membre éclairé
 
Avatar de Nowwis
 
Homme
Développeur Web
Inscription : juin 2009
Messages : 363
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 21
Localisation : France

Informations professionnelles :
Activité : Développeur Web

Informations forums :
Inscription : juin 2009
Messages : 363
Points : 365
Points : 365
Essaie de mettre une value à la checkbox, genre value="1" et fais

Code :
1
2
3
4
if(isset($_POST['magasin']) && $_POST['magasin'] == 1)
{
   ...
}
Nowwis est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/07/2011, 09h21   #7
Membre confirmé
 
Avatar de Retrokiller069
 
Homme Bertrand
Étudiant
Inscription : octobre 2010
Messages : 216
Détails du profil
Informations personnelles :
Nom : Homme Bertrand
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : octobre 2010
Messages : 216
Points : 268
Points : 268
pardon j'avais pas bien regarder ton code, tu ne dois pas faire que test si la varibale existe (car elle existe toujours dans ton cas) tu dois également regarder sa valeur.

il me semble (mais tu peux regarder ca facilement) que la valeur d'un checkbox c'est "on" si il l'est sélectionné.

ce qui donne:

Code :
if(isset($_POST['magasin']) && $_POST['magasin']=="on")
si le problème persiste, affiche (avec un echo) la valeur de ton $_POST['magasin'] avant son test et regarde ca valeur lorsqu'il est sélectionner et remplace le "on" par la valeur que tu as.

en espérant que ca marche
__________________
Ce n'est pas ce que nous voulons faire qui est impossible mais ce sont les moyens à sa mise en oeuvre qui peuvent le paraître

Ps: N'oubliez pas SVP
Retrokiller069 est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 26/07/2011, 10h23   #8
Invité de passage
 
Inscription : janvier 2010
Messages : 22
Détails du profil
Informations forums :
Inscription : janvier 2010
Messages : 22
Points : 2
Points : 2
Bonjour, encore merci de vos réponse rapide, mais malheureusement , cela ne marche pas

Code :
1
2
3
4
5
6
7
8
<?
echo $_POST['magasin'];
echo $_POST['stock'];
echo "123";
echo $_POST['Marteautest'];
if (isset($_POST['magasin']) && $_POST['magasin'] == 1 )	
{
?>
Je n'ai aucune réponse qui me sort de mes échos comme si il existait pas.

Et malgré tout c'est toujours le premier code qui s'affiche si jamais j'inverse les codes que ce soit magasin en deuxième et stock en premier je verrais toujours le premier
Atchoum89 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/07/2011, 10h39   #9
Membre éclairé
 
Avatar de Nowwis
 
Homme
Développeur Web
Inscription : juin 2009
Messages : 363
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 21
Localisation : France

Informations professionnelles :
Activité : Développeur Web

Informations forums :
Inscription : juin 2009
Messages : 363
Points : 365
Points : 365
Où as-tu mis ces "echo" ?

Essaie ce code et donne nous la réponse :

Code :
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<html>
<center>
<?php
echo "Magasin : ".$_POST['magasin'];
echo "Stock: ".$_POST['stock'];
echo "Test : 123";
 
?>
<br></br>
<form method="POST" action=""> 
Marteau : <input type="text" name="Marteautest">
<br></br>
<input type="checkbox" value="1" name="magasin" id="magasin" />verifier magasin</br>
<input type="checkbox" value="1" name="stock" id="stock" />verifier stock</br>
<input type="SUBMIT" value="Recherche"> 
</center>
<br></br>
 
<?php
if (isset($_POST['magasin']) && $_POST['magasin'] == 1 )
{
?>
	<center>
	<font face="Verdana" size="1">
	</font>
 
	<table border="0" cellpadding="0" cellspacing="0" width="80%" id="table1">
	  <tr>
 
	  	<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Peinture</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Perceuse</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Vis</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Planche</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Marteau</font></b></td>
 
	  </tr>
	</center>
<?php
include('../user_verif.php');
 
    $Marteautest = isset($_POST['Marteautest']) ? $_POST['Marteautest'] : '';
 
	//Connexion à la Base de donnée
 
	$sql->open();
 
	//Requête SQL
 
	$result = $sql->query("Select * From Magasin Where Marteau = '$Marteautest' order by Marque ASC");
 
	//Extraction et traitement
 
	while( $row = mysql_fetch_array( $result ) )
	{
 
		$Peinture = nl2br ( $row['Peinture '] );
 
		$Perceuse = nl2br ( $row['Perceuse '] );
 
		$Vis= nl2br ( $row['Vis'] );
 
		$Planche= nl2br ( $row['Planche'] );
 
		$Marteau= nl2br ( $row['Marteau'] );
 
	    echo '<center><tr>
		<td  align="center" style="border-left: 1px solid #000000; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Peinture.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Perceuse.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Vis.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Planche.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-right: 1px solid #000000; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Marteau.'</font></td>
 
	</tr></center>';
 
	}
 
//Fin du tableau
 
?>
	<center>
	  <tr>
		<td style="border-left: 1px solid #000000; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-right: 1px solid #000000; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
	  </tr>
	</table>
	</center>
	</div>
 
  </body>
 
  </html>
 
<?php
 
  //On ferme la connexion SQL
 
  $sql->close();
 
  exit;
 
?>
}
 
<?php
if (isset($_POST['stock']))	
{	
?>
	<font face="Verdana" size="1">
	</font>
	<center>
	<table border="0" cellpadding="0" cellspacing="0" width="80%" id="table1">
	  <tr>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Planche</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Marteau</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Clou</font></b></td>
	  </tr>
	</center>
</form>
</html>	  
 
<?php
include('../user_verif.php');
 
    $BAStest = isset($_POST['Marteautest']) ? $_POST['Marteautest'] : '';
 
	//Connexion à la Base de donnée
 
	$sql->open();
 
	//Requête SQL
 
	$result = $sql->query("Select * From stock Where marteau = '$Marteautest' and order by Marque ASC");
 
	//Extraction et traitement
 
	while( $row = mysql_fetch_array( $result ) )
	{
		  $Planche= nl2br ( $row['Planche'] );
 
		  $Marteau= nl2br ( $row['Marteau'] );
 
		  $Clou= nl2br ( $row['Clou'] );
 
	    echo '<tr><center>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Planche.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Marteau.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Clou.'</font></td>
		</center>
	</tr>';
 
	}
 
//Fin du tableau
 
?>
	<center>
	  <tr>
		<td style="border-left: 1px solid #000000; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-right: 1px solid #000000; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
	  </tr>
	</table>
	</center>
	</div>
 
  </body>
 
  </html>
 
<?php
 
  //On ferme la connexion SQL
 
  $sql->close();
 
  exit;
?>	
}
Nowwis est déconnecté   Envoyer un message privé Réponse avec citation 01
Vieux 26/07/2011, 10h47   #10
Invité de passage
 
Inscription : janvier 2010
Messages : 22
Détails du profil
Informations forums :
Inscription : janvier 2010
Messages : 22
Points : 2
Points : 2
Il m'affiche

"Parse error: parse error in C:\wampserver\www\CIRIS\admin\Bas2.php on line 196"

Donc il pointe sur la dernière accolade
Atchoum89 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/07/2011, 11h07   #11
Membre éclairé
 
Avatar de Nowwis
 
Homme
Développeur Web
Inscription : juin 2009
Messages : 363
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 21
Localisation : France

Informations professionnelles :
Activité : Développeur Web

Informations forums :
Inscription : juin 2009
Messages : 363
Points : 365
Points : 365
Raah c'est juste un if qui est pas fermé, je te mets le code mais essaie de trouver cette simple erreur la prochaine fois... On ne connait pas forcément l'architecture de ton code donc quand tu vois du parse error c'est une accolade ou un ; qui manque...
Si jamais ça ne marche pas, essaie de vérifier

Code :
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<html>
<center>
<?php
echo "Magasin : ".$_POST['magasin'];
echo "Stock: ".$_POST['stock'];
echo "Test : 123";
 
?>
<br></br>
<form method="POST" action=""> 
Marteau : <input type="text" name="Marteautest">
<br></br>
<input type="checkbox" value="1" name="magasin" id="magasin" />verifier magasin</br>
<input type="checkbox" value="1" name="stock" id="stock" />verifier stock</br>
<input type="SUBMIT" value="Recherche"> 
</center>
<br></br>
 
<?php
if (isset($_POST['magasin']) && $_POST['magasin'] == 1 )
{
?>
	<center>
	<font face="Verdana" size="1">
	</font>
 
	<table border="0" cellpadding="0" cellspacing="0" width="80%" id="table1">
	  <tr>
 
	  	<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Peinture</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Perceuse</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Vis</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Planche</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Marteau</font></b></td>
 
	  </tr>
	</center>
<?php
include('../user_verif.php');
 
    $Marteautest = isset($_POST['Marteautest']) ? $_POST['Marteautest'] : '';
 
	//Connexion à la Base de donnée
 
	$sql->open();
 
	//Requête SQL
 
	$result = $sql->query("Select * From Magasin Where Marteau = '$Marteautest' order by Marque ASC");
 
	//Extraction et traitement
 
	while( $row = mysql_fetch_array( $result ) )
	{
 
		$Peinture = nl2br ( $row['Peinture '] );
 
		$Perceuse = nl2br ( $row['Perceuse '] );
 
		$Vis= nl2br ( $row['Vis'] );
 
		$Planche= nl2br ( $row['Planche'] );
 
		$Marteau= nl2br ( $row['Marteau'] );
 
	    echo '<center><tr>
		<td  align="center" style="border-left: 1px solid #000000; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Peinture.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Perceuse.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Vis.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Planche.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-right: 1px solid #000000; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Marteau.'</font></td>
 
	</tr></center>';
 
	}
 
//Fin du tableau
 
?>
	<center>
	  <tr>
		<td style="border-left: 1px solid #000000; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-right: 1px solid #000000; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
	  </tr>
	</table>
	</center>
	</div>
 
  </body>
 
  </html>
 
<?php
 
  //On ferme la connexion SQL
 
  $sql->close();
 
  exit;
 
?>
}
 
<?php
if (isset($_POST['stock']))	
{	
?>
	<font face="Verdana" size="1">
	</font>
	<center>
	<table border="0" cellpadding="0" cellspacing="0" width="80%" id="table1">
	  <tr>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Planche</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Marteau</font></b></td>
 
		<td style="border-left-style: dotted; border-left-width: 1px; border-top: 1px solid #000000" bgcolor="#81ABD1" align="center" width="100">
		<b><font face="Verdana" size="2">Clou</font></b></td>
	  </tr>
	</center>
</form>
</html>	  
 
<?php
include('../user_verif.php');
 
    $BAStest = isset($_POST['Marteautest']) ? $_POST['Marteautest'] : '';
 
	//Connexion à la Base de donnée
 
	$sql->open();
 
	//Requête SQL
 
	$result = $sql->query("Select * From stock Where marteau = '$Marteautest' and order by Marque ASC");
 
	//Extraction et traitement
 
	while( $row = mysql_fetch_array( $result ) )
	{
		  $Planche= nl2br ( $row['Planche'] );
 
		  $Marteau= nl2br ( $row['Marteau'] );
 
		  $Clou= nl2br ( $row['Clou'] );
 
	    echo '<tr><center>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Planche.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Marteau.'</font></td>
		<td  align="center" style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #DBE7F2" bgcolor="#FFFFFF"><font face="Verdana" size="2">'.$Clou.'</font></td>
		</center>
	</tr>';
 
	}
 
//Fin du tableau
 
?>
	<center>
	  <tr>
		<td style="border-left: 1px solid #000000; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
		<td style="border-left-style: dotted; border-left-width: 1px; border-right: 1px solid #000000; border-bottom: 1px solid #000000" bgcolor="#FFFFFF">&nbsp;</td>
	  </tr>
	</table>
	</center>
	</div>
 
  </body>
 
  </html>
 
<?php
  //On ferme la connexion SQL
 
  $sql->close();
 
  exit;
}
?>
Nowwis est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 26/07/2011, 11h15   #12
Membre confirmé
 
Avatar de Retrokiller069
 
Homme Bertrand
Étudiant
Inscription : octobre 2010
Messages : 216
Détails du profil
Informations personnelles :
Nom : Homme Bertrand
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : octobre 2010
Messages : 216
Points : 268
Points : 268
lol j'ai mis du temps à le voir mais il y a une erreur, tes { doivent être dans la partie php et non dans la partie html ^^

ps: c'est pareil pour la ligne 114 ^^
__________________
Ce n'est pas ce que nous voulons faire qui est impossible mais ce sont les moyens à sa mise en oeuvre qui peuvent le paraître

Ps: N'oubliez pas SVP
Retrokiller069 est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 26/07/2011, 11h27   #13
Invité de passage
 
Inscription : janvier 2010
Messages : 22
Détails du profil
Informations forums :
Inscription : janvier 2010
Messages : 22
Points : 2
Points : 2
Merci les gars vous êtes géniaux :p
Atchoum89 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 12h05.


 
 
 
 
Partenaires

Hébergement Web