Bonjour,

voila j'ai créer un site php il y'a longtemps et je n'avais besoins qu'une page pour afficher les articles par exemple des filles:
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
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<?php
 
session_start();
 
include("fonctions-panier.php");
include("../include/session.php");
//include("../UneAnnonce/afficherchoixpaiment.js");
 
 
 
$idcateg=$_GET['details'];
$actionp=$_GET['action'];
$categorie=$_GET['categorie'];
 
 
$_SESSION['idc']=$idcateg;
$_SESSION['act']=$actionp;
$_SESSION['cat']=$categorie;
 
 
// --------------- Etape 2 -----------------
// On écrit les liens vers chacune des pages
// -----------------------------------------
 
// On met dans une variable le nombre de messages qu'on veut par page
$nombreDeMessagesParPage = 7; // Essayez de changer ce nombre pour voir :o)
// On récupère le nombre total de messages
$retour = ('SELECT COUNT(*) AS nb_produit FROM boutchou_produit 
INNER JOIN boutchou_categorie ON boutchou_produit.id_categorie=boutchou_categorie.id_categorie
INNER JOIN boutchou_genre ON boutchou_produit.id_genre=boutchou_genre.genre_id
WHERE boutchou_produit.id_categorie = "'.$idcateg.'"
AND (boutchou_genre.genre_id="1" OR boutchou_genre.genre_id = "3")
');
 
 
 
 
$retour	=  mysql_query($retour) or die('Erreur SQL !'.$retour.'<br>'.mysql_error());
 
$donnees = mysql_fetch_array($retour);
 
$totalDesMessages = $donnees['nb_produit'];
 
$body='Nbre de produits : '.$donnees['nb_produit'].'<br /><br />';
// On calcule le nombre de pages à créer
$nombreDePages  = ceil($totalDesMessages / $nombreDeMessagesParPage);
 
// Puis on fait une boucle pour écrire les liens vers chacune des pages
 
	// --------------- Etape 3 ---------------
// Maintenant, on va afficher les messages
// ---------------------------------------
 
if (isset($_GET['page']))
{
        $page = $_GET['page']; // On récupère le numéro de la page indiqué dans l'adresse (livreor.php?page=4)
}
else // La variable n'existe pas, c'est la première fois qu'on charge la page
{
        $page = 1; // On se met sur la page 1 (par défaut)
}
 
// On calcule le numéro du premier message qu'on prend pour le LIMIT de MySQL
$premierMessageAafficher = ($page - 1) * $nombreDeMessagesParPage;
 
$description = "l&#146;ile aux bouts'chou site de vente de vetements,accessoires,chaussures d'occasion,neuf pour entfants de la naissance a 12 ans";
$keywords = "vetements pour bebe,naissance,achat vetement pour enfants,achete vetements pour bebe,enfants,ventes de vetements,vetements pour enfants,accessoires pour enfants,chaussures pour enfants,vetements pour fille,garcon,boutschou,achat,vente,occasion,neuf,vente en ligne,mode,collection ete,collection hiver,vetement pas cher,";
$subject = "l&#146;ile aux bouts'chou site de vente de vetements,accessoires,chaussures d'occasion,neuf pour enfants de la naissance a 12 ans";
$fakea = "site de vente en ligne de vetement d occasion pour enfants";
$title = "la liste des annonces des produits pour les filles de 0-12 ans";
$fakea = "site de vente en ligne de vetement d occasion pour enfants";
 
$news = true;
$sondage = true;
 
 
$idcateg=$_GET['details'];
 
$actionp=$_GET['action'];
//$categorie=$_GET['categorie'];
 
$body.='<div id="produitRecherche">';
 
 
if($donnees['nb_produit']>'7')
{
$body.='<span style="color:white">Trier par :</span> ';
$body.='<a href="afficherAnnoncefille.php?details='.$idcateg.'&choix=taille" class="recherche"> |Taille|</a>
<a href="afficherAnnoncefille.php?page='.$idcateg.'&details='.$idcateg.'&choix=marque"  class="recherche">Marque|</a>
<a href="afficherAnnoncefille.php?page='.$idcateg.'&details='.$idcateg.'&choix=vetement"  class="recherche">Vetements|</a>
<a href="afficherAnnoncefille.php?page='.$idcateg.'&details='.$idcateg.'&choix=date"  class="recherche">Date|</a>
<a href="afficherAnnoncefille.php?page='.$idcateg.'&details='.$idcateg.'&choix=prix"  class="recherche">Prix|</a></div>';
}
 
$sql = "SELECT DISTINCT * FROM boutchou_produit
INNER JOIN boutchou_categorie ON boutchou_produit.id_categorie=boutchou_categorie.id_categorie
INNER JOIN boutchou_genre ON boutchou_produit.id_genre=boutchou_genre.genre_id
inner join boutchou_age on boutchou_produit.id_age=boutchou_age.age_id
inner join boutchou_marque on boutchou_produit.id_marque=boutchou_marque.id_marque
inner join boutchou_saison on boutchou_produit.id_saison=boutchou_saison.saison_id
inner join boutchou_sous_categorie on boutchou_produit.sous_categorie_ref=boutchou_sous_categorie.categorie_sous_id

WHERE boutchou_produit.id_categorie = '".$idcateg."'
AND (boutchou_genre.genre_id='1' OR boutchou_genre.genre_id = '3')
GROUP BY boutchou_produit.produit_id";
 
if ($choix=='taille')
{
	 $choixtaille = mysql_real_escape_string(htmlspecialchars ($choix));
	   $sql .= " order by age_tri asc ";
 
}
if ($choix=='marque')
{
	 $choixtaille = mysql_real_escape_string(htmlspecialchars ($choix));
	   $sql .= " order by libelle_marque asc ";
 
}
if ($choix=='saison')
{
	 $choixtaille = mysql_real_escape_string(htmlspecialchars ($choix));
	   $sql .= " order by id_saison asc ";
 
}
if ($choix=='vetement')
{
	 $choixtaille = mysql_real_escape_string(htmlspecialchars ($choix));
	   $sql .= " order by categorie_titre asc ";
 
}
if ($choix=='prix')
{
	 $choixtaille = mysql_real_escape_string(htmlspecialchars ($choix));
	   $sql .= " order by produit_prix asc ";
 
}
if ($choix=='date')
{
	 $choixtaille = mysql_real_escape_string(htmlspecialchars ($choix));
	   $sql .= " order by produit_id desc ";
 
}
 
	 $sql .= " LIMIT ". $premierMessageAafficher . ", ". $nombreDeMessagesParPage."";
 
 
 
	 $liste_pro	=  mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
	//and boutchou_genre.genre_id IN ('.implode(',', unserialize(urldecode($categorie))) .')
//and boutchou_genre.genre_id="1" OR (boutchou_genre.genre_id = "2")*/
 
while( $pro = mysql_fetch_assoc($liste_pro) )
{
/*if $pro[genre_id]==
{}else{}*/
 
	$body.='
			
					<table id="listeAnnonceProduits">
						<tr>';
			$liste_illustrations = mysql_query('SELECT *
FROM boutchou_produit
where boutchou_produit.ref_illustration='.$pro['ref_illustration'].'
group by boutchou_produit.produit_id');
				/*************A REPRENDRE PLUS TARD POUR IMAGE VIENNENT DES DONNES DE LA BASE**********/
	/*$liste_illustrations = mysql_query('SELECT *
FROM boutchou_illustration,boutchou_produit,boutchou_appartenir
where boutchou_produit.produit_id=boutchou_appartenir.id_produit
and boutchou_appartenir.id_illustration=boutchou_illustration.up_id
and boutchou_produit.produit_id='.$pro['produit_id'].'
and boutchou_produit.id_genre='.$pro['id_genre'].'
group by boutchou_produit.produit_id');*/
 
	$liste_sous_categorie=mysql_query('SELECT * FROM boutchou_produit,boutchou_categorie,boutchou_sous_categorie
	WHERE boutchou_produit.id_categorie=boutchou_categorie.id_categorie
	and boutchou_categorie.id_categorie=boutchou_sous_categorie.categorie_ref
and boutchou_produit.sous_categorie_ref=boutchou_sous_categorie.categorie_sous_id 
and boutchou_produit.produit_id='.$pro['produit_id'].'
and boutchou_produit.id_genre='.$pro['id_genre'].'
group by boutchou_produit.produit_id');
 
 
	while($illustration = mysql_fetch_assoc($liste_illustrations))
	{
 
 
 
 
		$body.='<td>
		<a href="illustration/'.($illustration['ref_illustration']).'.JPG" rel="lightbox" width="400" height="300" alt="image grand format"><img src="illustration/'.($illustration['ref_illustration']).'.JPG" class="illustration"></a></td>';
 
 
 
 
 
 
 
	}		
 
	while($sous_categorie = mysql_fetch_assoc($liste_sous_categorie))
	{
		$body.='<td style="text-transform:uppercase;text-align:center;color:blue;">'.$sous_categorie['categorie_titre'].'<br /><br /></td>';
 
 
	$liste_age = mysql_query('SELECT  distinct age_description FROM boutchou_age,boutchou_produit where boutchou_age.age_id='.$pro['id_age'].'');			
 
	$liste_marque = mysql_query('SELECT  distinct libelle_marque  FROM boutchou_marque,boutchou_produit where boutchou_marque.id_marque='.$pro['id_marque'].'');			
 
 
 
 
	while($marque = mysql_fetch_assoc($liste_marque))
	{	
		$body.='<td><span style="color:blue;">Marque :</span> '.$marque['libelle_marque'].'<br /><br />	';
 
 
	}	
		$body.='<span style="color:blue;">Couleur :</span> '.$pro['produit_couleur'].'<br /><br />';
 
	while($age = mysql_fetch_assoc($liste_age))
	{	
		$body.='<span style="color:blue;">Taille :</span> '.$age['age_description'].'<br /><br />';
		if  ($pro['est_disponble']!="1")
 
							{
								$body.='<span style="text-decoration:blink;color:red;margin-left:5px;">produit en stock</a></span>';
 
								}
								else
								{
								$body.='<span style="color:red;margin-left:5px;">Ce produit n&#146;est plus en stock</span></td>';
 
								}	
 
	}		
 
	$liste_etat = mysql_query('SELECT  distinct description_etat FROM boutchou_etat,boutchou_produit where boutchou_etat.id_etat='.$pro['id_etat'].'');			
 
		$body.='<td>';
	while($etat = mysql_fetch_assoc($liste_etat))
	{
 
		$body.='<span style="color:blue;">Etat :</span> '.$etat['description_etat'].'<br /><br />';
 
 
	}	
 
	$body.='<span style="color:blue;">Prix :</span> '.$pro['produit_prix'].'&euro;';
 
 
 
	if  ($pro['est_disponble']!="1"){
	/*$body.='<a href="panier.php?action=ajout&amp;id='.$pro['produit_id'].'&amp;l='.$sous_categorie['categorie_titre'].'&amp;q=1&amp;p='.$pro['produit_prix'].'" onclick="window.open(this.href, "", 
"toolbar=no, location=no, directories=no, status=yes, scrollbars=yes, resizable=yes, copyhistory=no, width=600, height=350");
return false;"><img src="../images/caddie.gif">Ajouter au panier</a>';*/
	$body.='<br /><br /><a href="choix.php?actionp=ajout&amp;id='.$pro['produit_id'].'&amp;l='.$sous_categorie['categorie_titre'].'&amp;q=1&amp;p='.$pro['produit_prix'].'&amp;r='.$pro['remise'].'"><img src="../images/caddie.gif">Ajouter au panier</a>';
		}
 
	//$body.=''.$pro['est_disponible'].'<b/><br />';
	$body.='
						
					
</td>			
		</tr>
	</table>';
 
 
 
 
 
	}
 
}
$body.='Page : ';
for ($i = 1 ; $i <= $nombreDePages ; $i++)
{
if($i==$_GET['page'])
{$_session['page']=$i;
	//$body.='<a href="afficherAnnonce.php?page='. $i . '&details='.$idcateg.'&categorie='.$categorie.'">' . $i . '</a> ';
	$body.='<a href="afficherAnnoncefille.php?page='. $i . '&details='.$idcateg.'&choix='.$choix.'"style="color:purple">' . $i . '</a>';
}
else
{$body.='<a href="afficherAnnoncefille.php?page='. $i . '&details='.$idcateg.'&choix='.$choix.'">|' . $i . '|</a>';}
}
include("../include/base.php");
?>

maintenant je suis au php5 et on m'a conseiller que lorsque que lon créer un produit ou une categorie on doit créer un dossier avec son nom et donc une page php de ce produit pour le presenter dans ce dossier.


par ex : dossier informatique > dossier oridnateur > dossier pc portable

ex de fichier informatique.php:
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
 
<?php
 
include(dirname(__FILE__).'/../../config/config.inc.php');
 
 
$description = "";
$keywords = "";
$title = "";
$fakea = "";
$menu = true;
$navigation = true;
$newsletters = true;
$publicite = true;
$caddie = true;
$nouveaute = true;
$top_ventes = true;
$body ="";
/*Recupere URL page*/ 
$url=$_SERVER['REQUEST_URI'];
/*separe les partie entre l'element "-" de l'URL*/
$element =Explode("-", $url);
/*recupere element id categorie avec extension .php */
$UrlAvecId=$element[0];
//echo $UrlAvecId;
/*separe les partie entre l'element "/" de l'URL*/
$element =Explode("/", $UrlAvecId);
/*recupere element id categorie*/
$IdCategorieSeul=$element[4];
/*recupere titre element dossier de la categorie*/
$TitreCategorie=$element[3];
/*instanciation class categorie*/
$objet=new Categorie;
 
/*recupere element de l'id donnée en parametre*/
$IdCategorie=$objet->findById($IdCategorieSeul);
/*recupere element de l'id_categorie(souscategorie) donnée en parametre*/
$IdSousCategorie=$objet->findSousCategorieById($IdCategorieSeul);
 
/*boucle foreach qui affiche le titre et l'url de id*/
$body.='<div class="espace_categorie">';
if ( ($tab = $IdSousCategorie ) !== null ) {
foreach( $tab as $IdSousCategorie) {
 
$body.='
<ul>
<img src="'.RACINE.'img/'.$IdSousCategorie->getIllustration().'">
<li><a href="'.RACINE.'AchatEnFolie2/'.$TitreCategorie.'/'.$IdSousCategorie->getUrl().'">'.$IdSousCategorie->getTitre().'</a></li>
</ul>';
}
}
$body.='



</div>';
 
include(dirname(__FILE__).'/../../config/base.php');
?>
ca fait bc vous ne trouvez pas alors que moi il me suffisait d'une page avant.