Advertisement
Guest User

Untitled

a guest
Jul 10th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.58 KB | None | 0 0
  1. <?php
  2.  
  3. include 'inc_connect_mysql.php';
  4. //Paramètres de connexion à la base de données :
  5. $server = 'localhost';
  6. $user = 'root';
  7. $password = '';
  8. $db= 'photo_fusion_web';
  9.             //On se connecte à la base avec les infos passées précédemment
  10.             connection_base($server,$user,$password,$db);
  11.             $rqt = " SELECT * FROM type_produit";
  12.             $result = mysql_query($rqt);
  13. ?>
  14.  
  15. <div id="menu">
  16.     <div class="element_menu">
  17.         <ul>
  18.             <!-- on affiche  un menu avec par défaut toujours ACCUEIL au début et contact à la fin -->
  19.             <li><a href='index.php'>Accueil</a> <!-- Si une catégorie est passée ( REFLEX ) on affiche alors un menu avec par défaut toujours ACCUEIL au début et contact à la fin -->
  20.         </ul>
  21. <?php   while ($ligne = mysql_fetch_array($result))
  22.         {
  23.     ?>
  24.         <ul>
  25.             <li><a href='produits_p.php?<?php echo "categorie=".$ligne['ID_type_produit']."&Niveau=ALL"; ?>' ><?php echo $ligne['Nom_type_produit']; ?></a></li>
  26.         <?php
  27.                 if($ligne['ID_type_produit'] == $_GET['categorie']) // Si la catégorie = celle sélectionnée, on affiche les différents niveaux ( débutant, intermediaire ... )
  28.                 {
  29.                        
  30.                         $rqt = " SELECT * FROM niveau where ID_type_produit=".$ligne['ID_type_produit']."";
  31.                         $result = mysql_query($rqt);
  32.                            
  33.                     while ($ligne = mysql_fetch_array($result)){
  34.                     ?>
  35.                     <ul>
  36.                         <li><a href='produits_p.php?<?php echo "categorie=".$_GET['categorie']."&Niveau=".$niveau; ?>' ><?php echo $ligne['Nom_niveau']; ?></a></li>
  37.                     </ul><?php
  38.                     }
  39.                 }?>
  40.                 </ul><?php
  41.         }
  42.             ?>
  43.                     <ul>
  44.                     <li><a href='contact.php'>Contact</a>
  45.                     </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement