Bonjour,
J'ai trouvé un bon script de caddie sur le site (http://www.phpcs.com/codes/CLASS-PANIER-CADDIE_29499.aspx)
Je voudrais le modifier pour que la page liste_article.php utilise MySQL pour aller chercher les informations sur les produits.
Mais j'ai un soucis, ma requette se perd en cours de route du coup, j'obtient une page blanche ...
Voici le code :
<?php
include_once 'panier.class.php';
session_start();
$contenu = "";
$page = null;
$page->base = ((isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? "https" : "http")."://".$_SERVER["HTTP_HOST"];
$page->dirname = dirname($_SERVER["SCRIPT_NAME"]);
$page->basename = basename($_SERVER["SCRIPT_NAME"]);
$page->origine = $page->base.$page->dirname."/".$page->basename.(isset($_SERVER["QUERY_STRING"]) ? "?".$_SERVER["QUERY_STRING"] : "");
$page->query = isset($_SERVER["QUERY_STRING"]) ? "?".$_SERVER["QUERY_STRING"]."" : "";
$page->protocol = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? "https" : "http";
$page->action = $page->protocol."://".$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"].$page->query;
print '
<html>
<head>
<title>Liste Article</title>
</head>
<body>
<form name="form1" method="post" action="'.$page->action.'" enctype="application/x-www-form-urlencoded">';
$contenu .= Affichages($page, $html);
print $contenu.'
</form>
</body>
</html>';
// affichage principal
function Affichages(&$page, &$html)
{
include('connexion.php');
$sql1 = "SELECT id,reference,designation,prixht FROM site_prod";
$req1 = mysql_query($sql1) or die('Erreur SQL !<br>'.$sql1.'<br>'.mysql_error());
mysql_close();
$out = '
<table border="0" cellspacing="0" cellpadding="0" width="80%" align="center">
<tr>
<td align="left"><b>Désignation</b></td>
<td align="left"><b>Référence</b></td>
<td align="right"><b>P.U. (HT)</b></td>
<td align="right"><b>P.U. (TTC)</b></td>
<td align="middle"><b>Panier</b></td>
</tr>
<tr>
';
while($data=mysql_fetch_assoc($req1)) { '
<td align="left">'.$data['designation'].'</td>
<td align="left">'.$data['reference'].'</td>
<td align="right">'.$data['prixht'].' €</td>
<td align="right">'.$data['prixttc'].' €</td>
<td align="middle"><input type="text" name="qte_1" value="1" size="4" />
<a href="#" onclick="document.location.href=\'ajout_panier.php?numserie='.$data['reference'].'&qte=\'+document.form1.qte_1.value+\'&prix='.$data['prix'].'&origine=liste_article.php?\'">Ajout Panier</a>
</td>
</tr>
</table>';
}
if (isset($_SESSION['panier'])) {
$page->panier = unserialize($_SESSION['panier']);
if (is_object($page->panier) && $page->panier->getNombreArticle() > 0) {
$out .= '
<br /><br />
<center><a href="consultation_panier.php">Voir Panier »</a></center>';
}
}
return $out;
}
?>
Pourriez vous m'aider ?? 
Merci beaucoup !
Antho