Eléphant du PHP |
148 Messages
17 nov. 2005, 16:28
Oui, mais du coup, je passe les variables ref et prix à cette page "intermédiaire" de quelle manière ? avec les sessions aussi ?
Pour comprendre, voici un bout de mon code :
<?php
require_once('../Connections/cnn.php');
if (!isset ($_GET['rubrikID']))
{
include ("defaut.php");
exit;
}
switch($_GET['rubrikID'])
{
case "1" :
if (!isset ($_GET['ref']))
{
include ("instrument.php");
break;
}
else
{
if (isset ($_GET['ref']))
{
$ref= $_GET['ref'];
// requete de selection de l'article
$query_rsarticles= sprintf("SELECT * FROM articles WHERE articles.reference='%s' ORDER BY articles.libelle ASC" , $ref);
$rsarticles=mysql_query($query_rsarticles, $cnn) or die(mysql_error());
$row_rsarticles = mysql_fetch_assoc($rsarticles);
$totalRows_rsarticles = mysql_num_rows($rsarticles);
// affichage de la fiche détaillée
echo "<font size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">Vous êtes ici : <a href=\"catalogue.php?rubrikID=defaut\">Produits</a> > <a href=\"catalogue.php?rubrikID=1\">Instruments</a> > ".$row_rsarticles['libelle'];
echo "<br><br><br><br>";
echo "<table width=\"90%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">";
echo "<tr>";
echo "<td width=\"3%\"><img src=\"../images/Tablo/haut_gauche.gif\"></td>";
echo "<td width=\"19%\" class=\"bh\">Photo</td>";
echo "<td width=\"11%\" class=\"bh\">Référence</td>";
echo "<td width=\"14%\" class=\"bh\">Libellé</td>";
echo "<td width=\"38%\" class=\"bh\">Description</td>";
// echo "<td width=\"9%\" class=\"bh\">Marque</td>";
echo "<td width=\"12%\" class=\"bh\">Prix</td>";
echo "<td width=\"3%\"><img src=\"../images/Tablo/haut_droit.gif\"></td>";
echo "</tr>";
echo "<tr> ";
echo "<td height=\"25\" class=\"bg\"></td>";
echo "<td bgcolor=\"#FFFFFF\" align=\"center\"><strong><a href=\"../images/boutique/articles/big/".$row_rsarticles['photo']."\"target=\"_blank\"><img src=\"../images/boutique/articles/".$row_rsarticles['photo']."\"alt=\"Cliquez sur l'image pour l'agrandir\" name=\"couverture\" width=\"168\" height=\"249\" border=\"0\"></a></strong></td>";
echo "<td bgcolor=\"#FFFFFF\" align=\"center\">".$row_rsarticles['reference']."</td>";
echo "<td bgcolor=\"#FFFFFF\" align=\"center\"><strong><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\">".$row_rsarticles['libelle']."</font></strong></td>";
echo "<td bgcolor=\"#FFFFFF\" align=\"center\"><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\">".$row_rsarticles['description']."</font><br><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><br><b>Marque :</b><br>".$row_rsarticles['auteur']."</font></td>";
// echo "<td bgcolor=\"#FFFFFF\" align=\"center\"><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\">".$row_rsarticles['auteur']."</font></td>";
echo "<td bgcolor=\"#FFFFFF\" align=\"center\"><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><b>".$row_rsarticles['prix']."</b></font></td>";
echo "<td class=\"bd\"> </td>";
echo "</tr>";
echo "<tr>";
echo "<td height=\"22\" class=\"bg\"> </td>";
echo "<td bgcolor=\"#FFFFFF\"> </td>";
echo "<td bgcolor=\"#FFFFFF\"> </td>";
// c'est ici qu'est le lien, là c'est juste du texte
echo "<td colspan=\"2\" bgcolor=\"#FFFFFF\"><font color=\"#009999\" size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><b>AJOUTER à mon panier</b></font></td>";
echo "<td bgcolor=\"#FFFFFF\"> </td>";
echo "<td class=\"bd\"> </td>";
echo "</tr>";
echo "<tr> ";
echo "<td><img src=\"../images/Tablo/bas_gauche.gif\"></td>";
echo "<td class=\"bb\"> </td>";
echo "<td class=\"bb\"> </td>";
echo "<td class=\"bb\"> </td>";
echo "<td class=\"bb\"> </td>";
// echo "<td class=\"bb\"> </td>";
echo "<td class=\"bb\"> </td>";
echo "<td><img src=\"../images/Tablo/bas_droit.gif\"></td>";
echo "</tr>";
echo "</table>";
break;
}
}
case "2" : include ("accessoires.php");break;
case "3" : include ("outils.php");break;
case "4" : include ("cd.php");break;
// Page Defaut
default : include("defaut.php"); // Sinon la page defaut.php s'affiche
}
?>
Que doit contenir mon lien ?
Et hop !