Problème de header

Répondre


Cette question est un moyen d’empêcher des soumissions automatisées de formulaires par des robots.
Smileys
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: =D> #-o =P~ :^o :non: :priere: 8-|
Voir plus de smileys
  Revue du sujet
 

  Étendre la vue Revue du sujet : Problème de header

par Gico » 06 nov. 2005, 03:04

j'ai viré les jointures et ça marche!!! il devait peut etre effectivement y avoir un espace quelque part...Merci, pour l'info pratique et la leçon de codage.

par Gico » 06 nov. 2005, 03:01

ok je vais suivre tes conseils et regarder ça de prés. Merci

par Truc » 06 nov. 2005, 02:56

oui mais non ça ne sert a rien de remettre ton code surtout que tout ce qui est apres la ligne de l'erreur est inutile, j'avais demandé d'éditer ton post parceque ça déforme la mise en page du forum et chez moi la barre horrizontale est tres tres longue :shock:

Mais ce qui est sur c'est que tu dois envoyer quelque chose avant le header, un espace ou meme un echo (ou print).

Ce que tu peut faire aussi c'est d'enlever les jointures de code php qui ne servent a rien non plus ça réduira deja la place pour les espaces:
.
?>
<?php 
a enlever ça!!

EDIT: il n'y a un pb avec les balises
 et l'ouverture php. Il faut donc enlever cette suite:
[code]?>
<?php [/code]

par Gico » 06 nov. 2005, 02:07

J'ai gardé l'essentiel du code, au cas ou il te reste du courage.... :wink:

Code : Tout sélectionner

if ($ajoutPanier=="AJOUTER" && $present == false) { $reference=$_GET['VARarticles']; $nb=1; //par défaut la quantité est = 1 $prixUnit=$_GET['prixUnit']; $totalarticle=$nb*$prixUnit; $liste[]=array($reference,$nb,$prixUnit,$totalarticle); $_SESSION['liste'] = array(); $_SESSION['liste']=$liste; } //----------------------------------------------------MODIF PANIER if ($modifPanier=="OK") { for ($i=0;$i<count($liste);$i++) { $nbi='nb'.$i; $liste[$i][1]=$_GET["$nbi"];//recup du nbr d'article dans la liste $liste[$i][3]=$liste[$i][1]*$liste[$i][2];//prixArticle=nbre*prixUnitaire } $_SESSION['liste']=$liste;//mAj de la liste } //----------------------------------------------------SUPP PANIER if ($suppPanier=="SUPPRIMER") { $article=$_GET['article']; for ($i=0;$i<count($liste);$i++) { if($article==$i) array_splice($liste,$i,1); //suppression de l'article } $_SESSION['liste']=$liste;//mAj de la liste } //----------------------------------------------------COMMANDER if ($enregistreCommande=="COMMANDER") { if(!isset($_GET['action'])) $_SESSION['action']="ENREGISTRER";//mémorise l'action necessaire pour la page commande. header("Location: login.php"); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Panier la centrale guitar</title> <script language="JavaScript"> <!-- function mmLoadMenus() {...

Code : Tout sélectionner

<?php if($liste[0][0]!="VIDE") { ?> <?php if ($ajoutPanier=="AJOUTER" && $present == true) { print "article déja présent dans le panier" ; } ?> <br> <form name="form2" method="get" action="../public/panier.php"> <table width="634" border="0"> <tr> <th scope="row">&nbsp;</th> <th width="382" bgcolor="#333366"scope="row"><div align="left">&nbsp;<span class="smal">DESIGNATION</span></div></th> <td bgcolor="#99CC00" class="smal" ><div align="center">Quantit&eacute;</div></td> <td bgcolor="#FF3333" class="smal" ><div align="center">Valider</div></td> <td bgcolor="#333366" class="smal"><div align="center">Prix TTC </div></td> <td bgcolor="#333366" class="smal"><div align="center"><span>Total TTC</span></div></td> <td width="26" bgcolor="#333366" class="smal"><div align="center">Suppr</div></td> </tr> <?php //debut script d'affichage $total=0.00; for ($i=0;$i<count($liste);$i++) { // a partir d'article Id stoqué dans "liste " recupere les differents coordonnée du produit $query_rsPanier="select * FROM articles, marque, categorie WHERE articles.ID = '".$liste[$i][0]."' AND marque.id=articles.marqueID AND categorie.ID=articles.categorieID" ; $rsPanier = mysql_query($query_rsPanier, $connexioncentrale_db) or die(mysql_error()); $row_rsPanier = mysql_fetch_assoc($rsPanier); ?>

Code : Tout sélectionner

<?php $cat = array(11, 12, 13, 14, 15, 16, 22, 23, 27, 28, 29, 30); $fiche = in_array($row_rsPanier['categorieID'], $cat) ? "fiche2" : "fiche"; ?> </a>&nbsp;&nbsp;<a href="#" class="articlpanier" onClick="open_windowfiche('<?php echo($fiche); ?>.php?VARarticles=<?php echo $row_rsPanier['ID']; ?>', 'ficheArticle', 'width=481,height=509')"><?php echo $row_rsPanier['reference'] ?></a>&nbsp;<span class="articategor">&nbsp;&nbsp;<?php echo $row_rsPanier['categorie'] ?></span></th> <td width="38" bgcolor="#FFFFFF"><div align="center"> <select name="nb<?php echo $i ?>" class="articlpanier" id="nb"> <option value="1" <?php if($liste[$i][1]==1) echo "SELECTED"; ?>>1</option> <option value="2" <?php if($liste[$i][1]==2) echo "SELECTED"; ?>>2</option> <option value="3" <?php if($liste[$i][1]==3) echo "SELECTED"; ?>>3</option> <option value="4" <?php if($liste[$i][1]==4) echo "SELECTED"; ?>>4</option> <option value="5" <?php if($liste[$i][1]==5) echo "SELECTED"; ?>>5</option> </select> </div></td> <td width="53" bgcolor="#FFFFFF"><div align="center"><font class="prixfiche"><strong> <input name="modifPanier" type="submit" class="articlpanier" value="OK"> </strong></font></div></td> <td width="53" align="right" bgcolor="#FFFFFF"><div align="right"><font class="articlpanier"> <?php $prixunit=$row_rsPanier['prix']; echo $prixunit ?> €</font></div></td> <td width="51" align="right" bgcolor="#FFFFFF"><font class="articlpanier"> <?php // affiche sous total $prix= $row_rsPanier['prix']*$liste[$i][1];$formatted = sprintf("%01.2f", $prix);echo $formatted ?> €</font></td> <td bgcolor="#FFFFFF"><div align="center"><a href="panier.php?articles=<?php echo $i ?>&suppPanier=SUPPRIMER" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('suppr','','../images/suppr1.gif',1)"><img src="../images/suppr0.gif" name="suppr" width="25" height="17" border="0"></a></div></td> </tr> <tr> <?php $total+=$row_rsPanier['prix'] * $liste[$i][1]; } ?>

par Gico » 06 nov. 2005, 02:01

J'ai enlevé la ligne ça ne change rien

je vais essayé d'editer mon code

par Truc » 06 nov. 2005, 01:32

Salut, as tu regardé a la ligne 42 ?
tu as un appel a une fonction, qui ne sert a rien puisque tu ne récupère de toute façon pas le résultat !

enleve cette ligne et refait un test:
verif_panier($reference);
et en passant édite ton dernier message et coupe cette ligne qui fait 2 km en plusieur morceaux avec des espaces parceque la c'est la mer.. :x

par Gico » 06 nov. 2005, 01:12

c'est dans la meme page, il s'agit un formulaire qui recharge la page et qui selon certaines conditions effectue des mises à jour de l'affichage (validation du changement du nombre d'articles)ou une redicrection - si l'usager valide la commande.
<?php require_once('../Connections/connexioncentrale_db.php'); ?>
<?php
session_start();
//init des variables
if (!isset($HTTP_SESSION_VARS['total'])) $HTTP_SESSION_VARS['total']=0;
if(!isset($_GET['ajoutPanier'])) $ajoutPanier="";//init de ajoutPanier si non déclaré
else  $ajoutPanier=$_GET['ajoutPanier'];
if(!isset($_GET['modifPanier'])) $modifPanier="";//init de modifPanier si non déclaré
else $modifPanier=$_GET['modifPanier'];
if(!isset($_GET['suppPanier'])) $suppPanier="";//init de suppPanier si non déclaré
else $suppPanier=$_GET['suppPanier'];
if(!isset($_GET['enregistreCommande'])) $enregistreCommande="";//init de enregistreCommande si non déclaré
else $enregistreCommande=$_GET['enregistreCommande'];
if ((!isset($HTTP_SESSION_VARS['liste']))&&($ajoutPanier=="")) $liste[]=array("VIDE",1,0,0);//init de liste si VIDE
if (isset($HTTP_SESSION_VARS['liste'])) $liste=$HTTP_SESSION_VARS['liste'];//recup de la liste de la session
?>
<?php
mysql_select_db($database_connexioncentrale_db, $connexioncentrale_db);
$query_rsMarque = "SELECT id, marque FROM marque ORDER BY marque ASC";
$rsMarque = mysql_query($query_rsMarque, $connexioncentrale_db) or die(mysql_error());
$row_rsMarque = mysql_fetch_assoc($rsMarque);
$totalRows_rsMarque = mysql_num_rows($rsMarque);
?>
<?php
/**
* Vérifie la présence d'un article dans le panier
*/
$reference=$_GET['VARarticles'];
function verif_panier($ref_article)
{
    $present = false;
    if(is_array($_SESSION['liste'][0]))
    {
        if(array_search($ref_article,$_SESSION['liste'][0]) != false)
        {
            $present = true;
        }
    }
    return $present;
}
verif_panier($reference);
?>
<?php
//----------------------------------------------------AJOUT PANIER cree liste
if ($ajoutPanier=="AJOUTER" && $present == false)
{
    $reference=$_GET['VARarticles'];
    $nb=1; //par défaut la quantité est = 1
    $prixUnit=$_GET['prixUnit'];
    $totalarticle=$nb*$prixUnit;
    $liste[]=array($reference,$nb,$prixUnit,$totalarticle);
    $_SESSION['liste'] = array();
    $_SESSION['liste']=$liste;
}
//----------------------------------------------------MODIF PANIER
if ($modifPanier=="OK")
{
    for ($i=0;$i<count($liste);$i++)
    {
        $nbi='nb'.$i;
        $liste[$i][1]=$_GET["$nbi"];//recup du nbr d'article dans la liste
        $liste[$i][3]=$liste[$i][1]*$liste[$i][2];//prixArticle=nbre*prixUnitaire
    }
    $_SESSION['liste']=$liste;//mAj de la liste
}
//----------------------------------------------------SUPP PANIER
if ($suppPanier=="SUPPRIMER")
{
    $article=$_GET['article'];
    for ($i=0;$i<count($liste);$i++)
    {
        if($article==$i)
        array_splice($liste,$i,1);
        //suppression de l'article
    }
    $_SESSION['liste']=$liste;//mAj de la liste
}
//----------------------------------------------------COMMANDER
if ($enregistreCommande=="COMMANDER")
{
    if(!isset($_GET['action']))
    $_SESSION['action']="ENREGISTRER";//mémorise l'action necessaire pour la page commande.
    header("Location: login.php");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Panier la centrale guitar</title>
<script language="JavaScript">
<!--
function mmLoadMenus() {
    if (window.mm_menu_0423002459_0) return;
    window.mm_menu_0423002459_0 = new Menu("root",171,17,"Verdana, Arial, Helvetica, sans-serif",10,"#ffffff","#99ff00","#000033","#000033","left","middle",2,0,800,-5,7,true,true,true,5,true,false);
    mm_menu_0423002459_0.addMenuItem("Guitares&nbsp;&nbsp;folk","window.open('catalogue_categorie.php?VARcategorie=2', '_self');");
    mm_menu_0423002459_0.addMenuItem("Guitares&nbsp;classiques","location='catalogue_categorie.php?VARcategorie=3'");
    mm_menu_0423002459_0.addMenuItem("Guitares&nbsp;electriques","location='catalogue_categorie.php?VARcategorie=1'");
    mm_menu_0423002459_0.addMenuItem("Guitares&nbsp;electro-acoustiques","location='catalogue_categorie.php?VARcategorie=5'");
    mm_menu_0423002459_0.addMenuItem("Guitares&nbsp;12&nbsp;cordes","location='catalogue_categorie.php?VARcategorie=18'");
    mm_menu_0423002459_0.addMenuItem("Guitares&nbsp;&agrave;&nbsp;resonateur","location='catalogue_categorie.php?VARcategorie=19'");
    mm_menu_0423002459_0.addMenuItem("Guitares&nbsp;demi-caisse","location='catalogue_categorie.php?VARcategorie=17'");
    mm_menu_0423002459_0.addMenuItem("Guitares&nbsp;de&nbsp;voyage","location='catalogue_categorie.php?VARcategorie=6'");
    mm_menu_0423002459_0.addMenuItem("Guitares&nbsp;enfant","location='catalogue_categorie.php?VARcategorie=7'");
    mm_menu_0423002459_0.addMenuItem("Packs&nbsp;guitare","location='catalogue_categorie.php?VARcategorie=20'");
    mm_menu_0423002459_0.hideOnMouseOut=true;
    mm_menu_0423002459_0.menuBorder=1;
    mm_menu_0423002459_0.menuLiteBgColor='#ffffff';
    mm_menu_0423002459_0.menuBorderBgColor='#ffffff';
    mm_menu_0423002459_0.bgColor='#ffffff';
    window.mm_menu_0423140718_1 = new Menu("root",164,17,"Verdana, Arial, Helvetica, sans-serif",10,"#ffffff","#99ff00","#000033","#000033","left","middle",2,0,800,-5,7,true,true,true,5,true,false);
    mm_menu_0423140718_1.addMenuItem("Basses&nbsp;electriques","location='catalogue_categorie.php?VARcategorie=9'");
    mm_menu_0423140718_1.addMenuItem("Basses&nbsp;electro-acoustiques","location='catalogue_categorie.php?VARcategorie=10'");
    mm_menu_0423140718_1.addMenuItem("Packs&nbsp;Basse","location='catalogue_categorie.php?VARcategorie=21'");
    mm_menu_0423140718_1.hideOnMouseOut=true;
    mm_menu_0423140718_1.menuBorder=1;
    mm_menu_0423140718_1.menuLiteBgColor='#ffffff';
    mm_menu_0423140718_1.menuBorderBgColor='#ffffff';
    mm_menu_0423140718_1.bgColor='#ffffff';
    window.mm_menu_0423141009_2 = new Menu("root",134,17,"Verdana, Arial, Helvetica, sans-serif",10,"#ffffff","#99ff00","#000033","#000033","left","middle",2,0,800,-5,7,true,true,true,5,true,false);
    mm_menu_0423141009_2.addMenuItem("Guitares&nbsp;electriques","location='catalogue_categorie.php?VARcategorie=11'");
    mm_menu_0423141009_2.addMenuItem("Guitares&nbsp;elctro-acous.","location='catalogue_categorie.php?VARcategorie=12'");
    mm_menu_0423141009_2.addMenuItem("Basses","location='catalogue_categorie.php?VARcategorie=13'");
    mm_menu_0423141009_2.addMenuItem("Basses&nbsp;electro-acous.","location='catalogue_categorie.php?VARcategorie=14'");
    mm_menu_0423141009_2.hideOnMouseOut=true;
    mm_menu_0423141009_2.menuBorder=1;
    mm_menu_0423141009_2.menuLiteBgColor='#ffffff';
    mm_menu_0423141009_2.menuBorderBgColor='#ffffff';
    mm_menu_0423141009_2.bgColor='#ffffff';
    window.mm_menu_0508181553_3 = new Menu("root",135,17,"Verdana, Arial, Helvetica, sans-serif",10,"#ffffff","#99ff00","#000033","#000033","left","middle",2,0,1000,-5,7,true,true,true,5,true,false);
    mm_menu_0508181553_3.addMenuItem("Cordes&nbsp;Gt.&nbsp;Folk","location='catalogue_categorie.php?VARcategorie=28'");
    mm_menu_0508181553_3.addMenuItem("Cordes&nbsp;Gt.&nbsp;Electriques","location='catalogue_categorie.php?VARcategorie=22'");
    mm_menu_0508181553_3.addMenuItem("Cordes&nbsp;Gt.&nbsp;Classiques","location='catalogue_categorie.php?VARcategorie=29'");
    mm_menu_0508181553_3.addMenuItem("Cordes&nbsp;Basses","location='catalogue_categorie.php?VARcategorie=23'");
    mm_menu_0508181553_3.addMenuItem("Housses","location='catalogue_categorie.php?VARcategorie=24'");
    mm_menu_0508181553_3.addMenuItem("Connectique","location='catalogue_categorie.php?VARcategorie=25'");
    mm_menu_0508181553_3.addMenuItem("Courroies","location='catalogue_categorie.php?VARcategorie=26'");
    mm_menu_0508181553_3.addMenuItem("Baffles","location='catalogue_categorie.php?VARcategorie=30'");
    mm_menu_0508181553_3.addMenuItem("Divers","location='catalogue_categorie.php?VARcategorie=27'");
    mm_menu_0508181553_3.hideOnMouseOut=true;
    mm_menu_0508181553_3.menuBorder=1;
    mm_menu_0508181553_3.menuLiteBgColor='#ecf1f2';
    mm_menu_0508181553_3.menuBorderBgColor='#ecf1f2';
    mm_menu_0508181553_3.bgColor='#ecf1f2';
    window.mm_menu_0423004326_1 = new Menu("root",115,17,"Verdana, Arial, Helvetica, sans-serif",10,"#000033","#ffffff","#99cc00","#99cc00","left","middle",2,0,800,-5,7,true,true,true,5,true,false);
    mm_menu_0423004326_1.addMenuItem("Qui&nbsp;sommes&nbsp;nous","location='qui.php'");
    mm_menu_0423004326_1.addMenuItem("Nos&nbsp;engagements","location='engagements.php'");
    mm_menu_0423004326_1.addMenuItem("Nos&nbsp;magasins","location='qui.php#plan'");
    mm_menu_0423004326_1.addMenuItem("Evenements","location='evenements.php'");
    mm_menu_0423004326_1.addMenuItem("Galerie&nbsp;d'artistes","location='galerie.php'");
    mm_menu_0423004326_1.hideOnMouseOut=true;
    mm_menu_0423004326_1.menuBorder=1;
    mm_menu_0423004326_1.menuLiteBgColor='#ffffff';
    mm_menu_0423004326_1.menuBorderBgColor='#ecf1f2';
    mm_menu_0423004326_1.bgColor='#ffffff';

    mm_menu_0423004326_1.writeMenus();
} // mmLoadMenus()
<!--
function open_windowfiche(fiche){
    var hauteur_popup = 509;
    var H = (screen.height - hauteur_popup) / 2;
    var largeur_popup = 481;
    var L = (screen.width - largeur_popup) /2;
    pop_up2 = Popup2=window.open(fiche, "Popup2", "status=no,scrollbars=no,resizable=no,height="+hauteur_popup+",width="+largeur_popup+",top="+H+",left="+L);
    window.Popup2.focus();
}
//-->
</script>
<script type="text/JavaScript" src="../jvs1.js"></script>
<link href="styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.searchbkg {
   background-image: url(../images/menus/index_r2_c11.jpg);
   background-repeat: no-repeat;
}
.articlpanier {
   font-family: Arial, Helvetica, sans-serif;
   font-size: 10px;
   font-weight: bold;
   text-transform: uppercase;
   color: #000033;
}
.articategor {
   font-family: Arial, Helvetica, sans-serif;
   font-size: 10px;
   font-weight: bold;
   text-transform: uppercase;
   color: #FF9900;
   font-style: italic;
}
.intro {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   font-size: 10px;
   color: #333366;
   padding: 5px;
   height: 40px;
   width: 520px;
   line-height: 14px;
   letter-spacing: 0.1em;
   text-align: left;
   vertical-align: top;
}
.intro2 {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   font-size: 9px;
   color: #BC1B21;
   line-height: 14px;
   border: 1px Aucune #C4BECA;
   letter-spacing: 0.1em;
   text-align: left;
   vertical-align: top;
   text-transform: uppercase;
   font-weight: bold;
}
-->
</style>
<script language="JavaScript1.2" src="../images/menus/mm_menu.js"></script>
<link href="link1.css" rel="stylesheet" type="text/css">
</head>
<body onLoad="MM_preloadImages('../images/menu_left/bonplans1.gif', '../images/menu_left/rare1.gif', '../images/menu_left/gauchers1.gif', '../images/packs1.gif', '../images/menu_left/devis1.gif', '../images/menu_left/coupdecoeur1.gif', '../images/suppr1.gif', '../images/menus/menu_magasins_r2_c3_f2.jpg', '../images/menus/menu_magasins_r2_c4_f2.jpg', '../images/menus/menu_magasins_r2_c6_f2.jpg', '../images/menus/menu_magasins_r2_c7_f2.jpg', '../images/menus/menu_magasins_r2_c8_f2.jpg', '../images/menus/menu_magasins_r2_c9_f2.jpg', '../images/menus/menu_magasins_r2_c10_f2.jpg', '../images/menus/menu_magasins_r2_c11_f2.jpg', '../images/menu_left/menuB_r1_c1_f2.gif', '../images/menu_left/menuB_r2_c1_f2.gif', '../images/menu_left/menuB_r3_c1_f2.gif', '../images/menu_left/menuB_r4_c1_f2.gif', '../images/menu_left/menuB_r5_c1_f2.gif', '../images/menu_left/menuB_r6_c1_f2.gif', '../images/menu_left/menuB_r7_c1_f2.gif', '../images/menus/index_r3_c3_f2.jpg', '../images/menus/index_r3_c4_f2.jpg', '../images/menus/index_r3_c6_f2.jpg', '../images/menus/index_r3_c7_f2.jpg', '../images/menus/index_r3_c8_f2.jpg', '../images/menus/index_r3_c9_f2.jpg', '../images/menus/index_r3_c10_f2.jpg', '../images/menus/index_r3_c12_f2.jpg')">
<table width="753" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td height="135" colspan="2" valign="top"><script language="JavaScript1.2">mmLoadMenus();</script>
      <table border="0" cellpadding="0" cellspacing="0" width="785">
        <!-- fwtable fwsrc="menu.png" fwbase="index.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
        <tr>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="104" height="1" border="0"></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="19" height="1" border="0"></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="73" height="1" border="0"></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="32" height="1" border="0"></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="37" height="1" border="0"></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="79" height="1" border="0"></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="66" height="1" border="0"></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="106" height="1" border="0"></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="112" height="1" border="0"></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="21" height="1" border="0"></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="54" height="1" border="0"></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="82" height="1" border="0"></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="1" height="1" border="0"></td>
        </tr>
        <tr>
          <td rowspan="2"><img name="index_r1_c1" src="../images/menus/index_r1_c1.jpg" width="104" height="109" border="0" usemap="#m_index_r1_c1" alt=""></td>
          <td rowspan="2" colspan="3"><img name="index_r1_c2" src="../images/menus/index_r1_c2.jpg" width="124" height="109" border="0" usemap="#m_index_r1_c2" alt=""></td>
          <td colspan="8"><img name="index_r1_c5" src="../images/menus/index_r1_c5.jpg" width="557" height="61" border="0" alt=""></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="1" height="61" border="0"></td>
        </tr>
        <tr>
          <td colspan="6"><img name="index_r2_c5" src="../images/menus/index_r2_c5.jpg" width="421" height="48" border="0" alt=""></td>
          <td colspan="2" class="searchbkg"><form name="form2" method="post" action="catalogue.php" class="search">
              <div align="right">
                <input name="search" type="text" class="txtlistessearch" id="search" value="Recherche" size="16" maxlength="40" onfocus="if(this.value==this.defaultValue)this.value=''">
                <input name="imageField" type="image" src="../images/menu_left/but_send.gif" align="bottom" width="18" height="19" border="0">
&nbsp;</div>
            </form></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="1" height="48" border="0"></td>
        </tr>
        <tr>
          <td colspan="2"><img name="index_r3_c1" src="../images/menus/index_r3_c1.jpg" width="123" height="25" border="0" alt=""></td>
          <td><a href="#" onMouseOut="MM_swapImgRestore();MM_startTimeout()" onMouseOver="MM_showMenu(window.mm_menu_0423002459_0,0,23,null,'index_r3_c3');MM_swapImage('index_r3_c3', '', '../images/menus/index_r3_c3_f2.jpg',1);"><img name="index_r3_c3" src="../images/menus/index_r3_c3.jpg" width="73" height="25" border="0" alt=""></a></td>
          <td colspan="2"><a href="#" onMouseOut="MM_swapImgRestore();MM_startTimeout()" onMouseOver="MM_showMenu(window.mm_menu_0423140718_1,0,23,null,'index_r3_c4');MM_swapImage('index_r3_c4', '', '../images/menus/index_r3_c4_f2.jpg',1);"><img name="index_r3_c4" src="../images/menus/index_r3_c4.jpg" width="69" height="25" border="0" alt=""></a></td>
          <td><a href="#" onMouseOut="MM_swapImgRestore();MM_startTimeout()" onMouseOver="MM_showMenu(window.mm_menu_0423141009_2,0,23,null,'index_r3_c6');MM_swapImage('index_r3_c6', '', '../images/menus/index_r3_c6_f2.jpg',1);"><img name="index_r3_c6" src="../images/menus/index_r3_c6.jpg" width="79" height="25" border="0" alt=""></a></td>
          <td><a href="catalogue_categorie.php?VARcategorie=15" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r3_c7', '', '../images/menus/index_r3_c7_f2.jpg',1);"><img name="index_r3_c7" src="../images/menus/index_r3_c7.jpg" width="66" height="25" border="0" alt=""></a></td>
          <td><a href="#" onMouseOut="MM_swapImgRestore();MM_startTimeout()" onMouseOver="MM_showMenu(window.mm_menu_0508181553_3,0,23,null,'index_r3_c8');MM_swapImage('index_r3_c8', '', '../images/menus/index_r3_c8_f2.jpg',1);"><img name="index_r3_c8" src="../images/menus/index_r3_c8.jpg" width="106" height="25" border="0" alt=""></a></td>
          <td><a href="#" onMouseOut="MM_swapImgRestore();MM_startTimeout()" onMouseOver="MM_showMenu(window.mm_menu_0423004326_1,0,23,null,'index_r3_c9');MM_swapImage('index_r3_c9', '', '../images/menus/index_r3_c9_f2.jpg',1);"><img name="index_r3_c9" src="../images/menus/index_r3_c9.jpg" width="112" height="25" border="0" alt=""></a></td>
          <td colspan="2"><a href="../public/vendre.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r3_c10', '', '../images/menus/index_r3_c10_f2.jpg',1);"><img name="index_r3_c10" src="../images/menus/index_r3_c10.jpg" width="75" height="25" border="0" alt=""></a></td>
          <td><a href="contact.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r3_c12', '', '../images/menus/index_r3_c12_f2.jpg',1);"><img name="index_r3_c12" src="../images/menus/index_r3_c12.jpg" width="82" height="25" border="0" alt=""></a></td>
          <td><img src="../images/menus/spacer.gif" alt="" name="undefined_3" width="1" height="25" border="0"></td>
        </tr>
        <map name="m_index_r1_c1">
          <area shape="rect" coords="8,9,143,109" href="..//index.php" target="_self" alt="" >
        </map>
        <map name="m_index_r1_c2">
          <area shape="rect" coords="-96,9,39,109" href="..//index.php" target="_self" alt="" >
        </map>
      </table></td>
  </tr>
  <tr>
    <td width="146" rowspan="2" valign="top"><p>
      <!-- #BeginLibraryItem "/Library/menuLeft.lbi" -->
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../images/menu_left/bonplans1.gif', '../images/menu_left/rare1.gif', '../images/menu_left/gauchers1.gif', '../images/packs1.gif', '../images/menu_left/coupdecoeur1.gif', '../images/menu_left/menuB_r1_c1_f2.gif', '../images/menu_left/menuB_r2_c1_f2.gif', '../images/menu_left/menuB_r3_c1_f2.gif', '../images/menu_left/menuB_r4_c1_f2.gif', '../images/menu_left/menuB_r5_c1_f2.gif', '../images/menu_left/menuB_r6_c1_f2.gif', '../images/menu_left/menuB_r7_c1_f2.gif')">
<table width="12%" border="0" topmargin="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="147" height="173" valign="top"><form name="form1" method="get"  action="catalogue_marques.php">
        <div align="center">
          <img src="../images/menu_left/accesdirect.gif" width="146" height="21">
            <select name="VARmarque" id="VARmarque" class="search">
              <?php
              do {
?>
              <option value="<?php echo $row_rsMarque['id']?>"><?php echo $row_rsMarque['marque']?></option>
              <?php
              } while ($row_rsMarque = mysql_fetch_assoc($rsMarque));
              $rows = mysql_num_rows($rsMarque);
              if($rows > 0) {
                  mysql_data_seek($rsMarque, 0);
                  $row_rsMarque = mysql_fetch_assoc($rsMarque);
              }
?>
            </select>
            <input type="image" src="../images/menu_left/but_send.gif" align="top" width="18" height="19" border="0">
            <a href="catalogue_bonplan.php?VARbonplan=2" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('bonplans', '', '../images/menu_left/bonplans1.gif',1)"><img src="../images/menu_left/bonplans0.gif" name="bonplans" width="146" height="21" border="0" align="top"></a><a href="catalogue_rare.php?VARrare=2" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('rare&collectible', '', '../images/menu_left/rare1.gif',1)"><img src="../images/menu_left/rare0.gif" name="rare&collectible" width="146" height="21" border="0"></a><a href="catalogue_gaucher.php?VARgaucher=2" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('gauchers', '', '../images/menu_left/gauchers1.gif',1)"><img src="../images/menu_left/gauchers0.gif" name="gauchers" width="146" height="21" border="0"></a><a href="catalogue_packs.php?VARpack=ok" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('packs', '', '../images/packs1.gif',1)"><img src="../images/packs0.gif" name="packs" width="146" height="21" border="0">
            </a><a href="coupsdecoeur.php?VARcoudcoeur=2" onMouseOver="MM_swapImage('devis', '', '../images/menu_left/coupdecoeur1.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="../images/menu_left/coupdecoeur0.gif" name="devis" width="146" height="21" border="0"></a>
        <table border="0" cellpadding="0" cellspacing="0" width="146">
            <!-- fwtable fwsrc="sous_menu_left.png" fwbase="menuB.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
            <tr>
              <td><img src="../images/menu_left/spacer.gif" alt="" name="undefined_2" width="146" height="1" border="0"></td>
              <td><img src="../images/menu_left/spacer.gif" alt="" name="undefined_2" width="1" height="1" border="0"></td>
            </tr>
            <tr>
              <td><a href="guides.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menuB_r1_c1', '', '../images/menu_left/menuB_r1_c1_f2.gif',1);"><img name="menuB_r1_c1" src="../images/menu_left/menuB_r1_c1.gif" width="146" height="21" border="0" alt=""></a></td>
              <td><img src="../images/menu_left/spacer.gif" alt="" name="undefined_2" width="1" height="21" border="0"></td>
            </tr>
            <tr>
              <td><a href="livraison.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menuB_r2_c1', '', '../images/menu_left/menuB_r2_c1_f2.gif',1);"><img name="menuB_r2_c1" src="../images/menu_left/menuB_r2_c1.gif" width="146" height="17" border="0" alt=""></a></td>
              <td><img src="../images/menu_left/spacer.gif" alt="" name="undefined_2" width="1" height="17" border="0"></td>
            </tr>
            <tr>
              <td><a href="services.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menuB_r3_c1', '', '../images/menu_left/menuB_r3_c1_f2.gif',1);"><img name="menuB_r3_c1" src="../images/menu_left/menuB_r3_c1.gif" width="146" height="18" border="0" alt=""></a></td>
              <td><img src="../images/menu_left/spacer.gif" alt="" name="undefined_2" width="1" height="18" border="0"></td>
            </tr>
            <tr>
              <td><a href="paiements.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menuB_r4_c1', '', '../images/menu_left/menuB_r4_c1_f2.gif',1);"><img name="menuB_r4_c1" src="../images/menu_left/menuB_r4_c1.gif" width="146" height="16" border="0" alt=""></a></td>
              <td><img src="../images/menu_left/spacer.gif" alt="" name="undefined_2" width="1" height="16" border="0"></td>
            </tr>
            <tr>
              <td><a href="galerie.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menuB_r5_c1', '', '../images/menu_left/menuB_r5_c1_f2.gif',1);"><img name="menuB_r5_c1" src="../images/menu_left/menuB_r5_c1.gif" width="146" height="16" border="0" alt=""></a></td>
              <td><img src="../images/menu_left/spacer.gif" alt="" name="undefined_2" width="1" height="16" border="0"></td>
            </tr>
            <tr>
              <td><a href="fun.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menuB_r6_c1', '', '../images/menu_left/menuB_r6_c1_f2.gif',1);"><img name="menuB_r6_c1" src="../images/menu_left/menuB_r6_c1.gif" width="146" height="17" border="0" alt=""></a></td>
              <td><img src="../images/menu_left/spacer.gif" alt="" name="undefined_2" width="1" height="17" border="0"></td>
            </tr>
            <tr>
              <td><a href="newsletter.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menuB_r7_c1', '', '../images/menu_left/menuB_r7_c1_f2.gif',1);"><img name="menuB_r7_c1" src="../images/menu_left/menuB_r7_c1.gif" width="146" height="20" border="0" alt=""></a></td>
              <td><img src="../images/menu_left/spacer.gif" alt="" name="undefined_2" width="1" height="20" border="0"></td>
            </tr>
          </table>
        </div>
      </form></td>
  </tr>
</table><!-- #EndLibraryItem --></p>
    </td>
    <td width="640" height="181" align="center" valign="top">
          <p><img src="../images/panier.gif" width="322" height="32"><br>
          <a href="javascript:history.back()" class="linkR">Page pr&eacute;c&eacute;dente</a></p>
          <p class="intro"><em>3 &eacute;tapes pour passer une commande:</em><br>
            <strong>1 -</strong> <strong>validez</strong> <strong>votre panier</strong> et les <strong>quantit&eacute;s</strong> de chaque articles. <br>
            <strong>2 -</strong> <strong>identifiez-vous</strong> (ou cr&eacute;ez votre compte).<br>
            <strong>3 -</strong> choisissez votre <strong>mode de r&egrave;glement</strong> et <strong>validez votre commande</strong>.<br>
            <strong class="intro2">Des r&eacute;ception de votre commande un de nos employ&eacute;s vous contactera pour preciser un eventuel choix de colori et pour valider le mode de paiment. </strong><br>
    </p></td>
  </tr>
  <tr>
    <td height="2" valign="top"><?php if($liste[0][0]!="VIDE") { ?>
 <?php
 if ($ajoutPanier=="AJOUTER" && $present == true)
 {
     print "article déja présent dans le panier" ;
 }
 ?> <br>
     <form name="form2" method="get" action="../public/panier.php">
        <table width="634" border="0">
          <tr>
            <th  scope="row">&nbsp;</th>
            <th width="382" bgcolor="#333366"scope="row"><div align="left">&nbsp;<span class="smal">DESIGNATION</span></div></th>
            <td bgcolor="#99CC00" class="smal" ><div align="center">Quantit&eacute;</div></td>
            <td bgcolor="#FF3333" class="smal" ><div align="center">Valider</div></td>
            <td bgcolor="#333366" class="smal"><div align="center">Prix TTC </div></td>
            <td bgcolor="#333366" class="smal"><div align="center"><span>Total TTC</span></div></td>
            <td width="26" bgcolor="#333366" class="smal"><div align="center">Suppr</div></td>
          </tr>
          <?php
          //debut script d'affichage
          $total=0.00;
          for ($i=0;$i<count($liste);$i++)
          {
              // a partir d'article Id stoqué dans "liste " recupere les differents coordonnée du produit
              $query_rsPanier="select * FROM articles, marque, categorie  WHERE articles.ID = '".$liste[$i][0]."' AND  marque.id=articles.marqueID AND categorie.ID=articles.categorieID" ;
              $rsPanier = mysql_query($query_rsPanier, $connexioncentrale_db) or die(mysql_error());
              $row_rsPanier = mysql_fetch_assoc($rsPanier);
   ?>
          <tr bgcolor="#CCCC99">
            <th width="3" align="right" bgcolor="#FFFFFF" scope="row">&nbsp;</th>
            <th align="left" bgcolor="#FFFFFF" scope="row">&nbsp;<span class="articlpanier"><?php echo $row_rsPanier['marque'] ?></span>
         <?php
         $cat = array(11, 12, 13, 14, 15, 16, 22, 23, 27, 28, 29, 30);
         $fiche = in_array($row_rsPanier['categorieID'], $cat) ? "fiche2" : "fiche";
?>
</a>&nbsp;&nbsp;<a href="#" class="articlpanier" onClick="open_windowfiche('<?php echo($fiche); ?>.php?VARarticles=<?php echo $row_rsPanier['ID']; ?>', 'ficheArticle', 'width=481,height=509')"><?php echo $row_rsPanier['reference'] ?></a>&nbsp;<span class="articategor">&nbsp;&nbsp;<?php echo $row_rsPanier['categorie'] ?></span></th>
            <td width="38" bgcolor="#FFFFFF"><div align="center">
                <select name="nb<?php echo $i ?>" class="articlpanier" id="nb">
                  <option value="1" <?php if($liste[$i][1]==1) echo "SELECTED"; ?>>1</option>
                  <option value="2" <?php if($liste[$i][1]==2) echo "SELECTED"; ?>>2</option>
                  <option value="3" <?php if($liste[$i][1]==3) echo "SELECTED"; ?>>3</option>
                  <option value="4" <?php if($liste[$i][1]==4) echo "SELECTED"; ?>>4</option>
                  <option value="5" <?php if($liste[$i][1]==5) echo "SELECTED"; ?>>5</option>
                </select>
              </div></td>
            <td width="53" bgcolor="#FFFFFF"><div align="center"><font class="prixfiche"><strong>
                <input name="modifPanier" type="submit" class="articlpanier" value="OK">
                </strong></font></div></td>
            <td width="53" align="right" bgcolor="#FFFFFF"><div align="right"><font class="articlpanier">
                <?php $prixunit=$row_rsPanier['prix']; echo $prixunit ?>
€</font></div></td>
            <td width="51" align="right" bgcolor="#FFFFFF"><font class="articlpanier">
         
              <?php
              // affiche sous total
           $prix= $row_rsPanier['prix']*$liste[$i][1];$formatted = sprintf("%01.2f", $prix);echo $formatted ?>
€</font></td>
            <td bgcolor="#FFFFFF"><div align="center"><a href="panier.php?articles=<?php echo $i ?>&suppPanier=SUPPRIMER"  onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('suppr', '', '../images/suppr1.gif',1)"><img src="../images/suppr0.gif" name="suppr" width="25" height="17" border="0"></a></div></td>
          </tr>
          <tr>
            <?php

            $total+=$row_rsPanier['prix'] * $liste[$i][1];
          }
?>
            <th colspan="2" scope="row"><p>&nbsp;</p></th>
            <td height="21" colspan="5" align="right" bgcolor="#FFFFFF"><font class="prixfiche"><strong><br>
              </strong></font> </td>
          </tr>
          <tr align="right">
            <th colspan="7" scope="row"><div align="right"><img src="../images/traitpointblu.gif" width="618" height="2" align="right"><font class="prixfiche"><strong>&nbsp;&nbsp;&nbsp;</strong></font></div></th>
          </tr>
          <tr>
            <th scope="row"><span class="mjBs"></span></th>
            <th colspan="6" scope="row"><div align="left">
                <table width="495" border="0" align="right">
                  <tr>
                    <th height="21" colspan="2" scope="row"><div align="right"><span class="mjBs"><strong>Total :</strong></span></div></th>
                    <td width="12"><span class="mjBs"></span><font class="mjBs"></font></td>
                    <td width="128"><font class="mjBs"><strong><?php echo $total ?> € TTC&nbsp;</strong></font></td>
                  </tr>
                  <tr>
                    <th height="20" colspan="2" scope="row"><div align="right" class="mjGs"><span>Dont TVA (19,6%) :</span></div></th>
                    <td></td>
                    <td><span class="mjGs" >
                      <?php $tva= $total-(($total/119.6)*100) ;$formattedtva = sprintf("%01.2f", $tva);echo $formattedtva ?>
 &nbsp;€</span></td>
                  </tr>
                  <tr>
                    <th colspan="2" scope="row"><div align="right" class="mjBs">FRAIS de Port : </div></th>
                    <td align="left" valign="middle"><span>
                      &nbsp; </span></td>
                    <td align="left" valign="middle" class="gaucher"><p><span class="mjBs">
                        <?php
                        if ($total<= 60 && $total>0)
                        {
                            $port ='10'; echo $port;
                        }

                        elseif ($total> 60 && $total<= 600)
                        {
                            $port ='20'; echo $port;
                        }

                        elseif ($total> 600)
                        {
                            $port ='0'; echo "0";
                        }
                        elseif ($total= 0)
                        {
                            $port ='0'; echo $port ;
                        }
                 ?>
                        <font class="mjBs"><strong> &nbsp;€</strong></font></span> &nbsp;&nbsp;<font class="textebleuC">
                        <?php if ($total> 600)
                        {
                            echo "OFFERTS";
                 } ?>
                        </font></p>
                    </td>
                  </tr>
                  <tr>
                    <th colspan="4" scope="row"><div align="right"><img src="../images/traitpointbluS.gif" width="323" height="2"></div></th>
                  </tr>
                  <tr>
                    <th width="101" scope="row">&nbsp;</th>
                    <th width="236"  scope="row"><div align="right"><span class="marque_fiche">NET A PAYER </span>: </div></th>
                    <td align="left" valign="middle">&nbsp;</td>
                    <td align="left" valign="middle" class="marque_fiche" >
               <?php
               $netapayer= $total + $port; echo $netapayer
               ?> <span class="marque_fiche"><font class="marque_fiche"><strong>€ TTC </strong></font></span></td>
                  </tr>
                </table>
              </div></th>
          </tr>
          <tr>
            <th colspan="7" scope="row"><span class="pagination"> </span>
              <div align="left">
                <p>&nbsp;</p>
              </div></th>
          </tr>
          <tr>
            <th colspan="7" scope="row">&nbsp;&nbsp;
              <input name="enregistreCommande" type="submit" class="mjBs" value="COMMANDER">
</th>
          </tr>
        </table>
        <?php } else { ?>
      </form>
      <p align="center" class="warning">Votre panier est vide</p>
      <?php }?>
    </td>
  </tr>
  <tr>
    <td height="116" colspan="2" valign="top"><!-- #BeginLibraryItem "/Library/bas de page.lbi" -->
<table border="0" cellpadding="0" cellspacing="0" margin-top="0" width="785">
  <!-- fwtable fwsrc="Basdepage.png" fwbase="footer-link.gif" fwstyle="Dreamweaver" fwdocid = "1690743520" fwnested="0" -->
  <tr>
    <td><img src="../images/footer-link/spacer.gif" alt="" name="undefined_2" width="98" height="1" border="0"></td>
    <td><img src="../images/footer-link/spacer.gif" alt="" name="undefined_2" width="660" height="1" border="0"></td>
    <td><img src="../images/footer-link/spacer.gif" alt="" name="undefined_2" width="27" height="1" border="0"></td>
    <td><img src="../images/footer-link/spacer.gif" alt="" name="undefined_2" width="1" height="1" border="0"></td>
  </tr>
  <tr>
    <td rowspan="2" valign="top"><img src="../images/basdepage/basdepage_r1_c1.gif" alt="" name="footer-link_r1_c1_2" width="98" height="96" border="0" align="top"></td>
    <td><img src="../images/basdepage/basdepage_r1_c2.gif" width="660" height="38"></td>
    <td rowspan="2" valign="top"><img src="../images/basdepage/basdepage_r1_c3.gif" alt="" name="footer-link_r1_c3_2" width="27" height="96" border="0" align="top"></td>
    <td><img src="../images/footer-link/spacer.gif" alt="" name="undefined_2" width="1" height="38" border="0"></td>
  </tr>
  <tr>
    <td height="58" valign="top" bgcolor="#000033" cellpadding="0" cellspacing="0"><div align="center">|<a href="contact.php" class="footer-link">contact</a> | <a href="qui.php"  class="footer-link" >qui sommes-nous ?</a> | <a href="qui.php#plan"  class="footer-link">nous rendre visite</a> | <a href="services.php"  class="footer-link">garanties</a> | <a href="paiements.php"  class="footer-link">modes de paiement</a> | <a href="conditons%20de%20vente.htm" target="_blank"  class="footer-link">conditions de vente</a>|<br>
        <span class="smal">© 2005 La Centrale Guitars 12 rue de Douai. 75009 Paris<br>
        Tél.: 01 42 85 18 70 Fax 01 49 21 07 71.<br>
        Du lundi au samedi de 10h30 à 13h et de 14h à 19h.</span></div></td>
    <td><img src="../images/footer-link/spacer.gif" alt="" name="undefined_2" width="1" height="58" border="0"></td>
  </tr>
</table>
<!-- #EndLibraryItem --></td>
  </tr>
</table>
</body>
</html>
<?php
mysql_free_result($rsMarque);
?>

par Pieterjan » 06 nov. 2005, 00:42

Et dans la page qui appelle ce script ?
(a moins que ce ne soit déjà l'index, mais j'en doutes).

par Gico » 05 nov. 2005, 21:41

si oui, j'ai ça:
<?php
//----------------------------------------------------AJOUT PANIER cree liste
if ($ajoutPanier=="AJOUTER" && $present == false)
{ 
$reference=$_GET['VARarticles'];
$nb=1; //par défaut la quantité est = 1
$prixUnit=$_GET['prixUnit'];
$totalarticle=$nb*$prixUnit;
$liste[]=array($reference,$nb,$prixUnit,$totalarticle);
$_SESSION['liste'] = array();
$_SESSION['liste']=$liste;
}
//----------------------------------------------------MODIF PANIER
if ($modifPanier=="OK")
{
	 for ($i=0;$i<count($liste);$i++)
		{
		$nbi='nb'.$i;
		$liste[$i][1]=$_GET["$nbi"];//recup du nbr d'article dans la liste
		$liste[$i][3]=$liste[$i][1]*$liste[$i][2];//prixArticle=nbre*prixUnitaire
		}
	$_SESSION['liste']=$liste;//mAj de la liste
}
//----------------------------------------------------SUPP PANIER
if ($suppPanier=="SUPPRIMER")
{
	$article=$_GET['article'];
	for ($i=0;$i<count($liste);$i++)
		{
		if($article==$i)
			array_splice($liste,$i,1);
		//suppression de l'article
		}
	$_SESSION['liste']=$liste;//mAj de la liste
}
//----------------------------------------------------COMMANDER
if ($enregistreCommande=="COMMANDER")
{
	if(!isset($_GET['action'])) 
	$_SESSION['action']="ENREGISTRER";//mémorise l'action necessaire pour la page commande.
	header("Location: login.php");
}
?>

par Gico » 05 nov. 2005, 21:39

43 c'est la ligne ?

par Ripat » 05 nov. 2005, 21:34

Il ya certainement une sortie avant ton header.

Suffit d'aller voir ce qu'il y a en /home/centrale/www/public/panier.php:43

:wink:

par Gico » 05 nov. 2005, 20:59

je trouve pas d'espace, est-ce qu'on peut remplacer le header par autre chose ici ? :
if ($enregistreCommande=="COMMANDER")
{
if(!isset($_GET['action']))
$_SESSION['action']="ENREGISTRER";
header("Location: login.php");
}
Le but etant simplement d'ouvrir une page si la condition est vérifiée

par Pieterjan » 05 nov. 2005, 20:15

les headers doivent être envoyées avant une quelconque information venant de la page elle même.. vérifie si tu n'as pas d'espaces dans le vide, comme avant les <?, dans les includes, ou si t'as pas déjà envoyé un truc par un "écho".

Problème de header

par Gico » 05 nov. 2005, 19:46

Bonjour

Aprés avoir mis en ligne, une page a laquelle je doit acceder m'affiche cette erreur:
Warning: Cannot modify header information - headers already sent by (output started at /home/centrale/www/public/panier.php:43) in /home/centrale/www/public/panier.php on line 84

le code incriminé est celui-ci, plus particulièrement la dernière ligne:

Code : Tout sélectionner

if ($enregistreCommande=="COMMANDER") { if(!isset($_GET['action'])) $_SESSION['action']="ENREGISTRER"; header("Location: login.php"); }
Tous ça fonctionnait trés bien en local, anoter que l'hebergement se fait sur OVH.

Si quelqun connait la solution...Merci