Aide - Recherche - Membres - Calendrier
Version complète : pb de header
Forum Développeur - Administration serveur, programmation et base de données > Programmation > PHP
aguiv
Bonjour à tous,

j'ai un pb de header que je n'arrive pas à résoudre : dans ma page panier (pour un site vente en ligne fait sous dreamMX) lorsque le client clique sur le bouton Commander il doit être dirigé sur la page Commande (d'ou le header). Or à chaque fois, le web local repond "page introuvable...".
Voici le code de ma page panier,
si vous trouvez le pb, gd merci parce que je suis complètement bloqué avec ce pb.

<?php
mysql_select_db($database_ConnectionSiteRDT, $ConnectionSiteRDT);

//----------------------COMMANDER
if ($enregistreCommande=="COMMANDER")
{
if(!isset($action))
session_register("action");//mémorise l'action
$action="enregistre";
header("Location:commande.php");
}
//----------------------AJOUT PANIER
if ($ajoutPanier=="AJOUTER")
{
$reference=$HTTP_GET_VARS['reference'];
$nb=1; //par défaut la quantité est = 1
$prix=$HTTP_GET_VARS['prix'];
$liste[]=array($reference,$nb,$prix,$prix);
$HTTP_SESSION_VARS['liste']=$liste;
//ajoute un article à la liste
}
//------------------MODIF PANIER
if ($modifPanier=="ACTUALISER")
{
for ($i=0;$i<count($liste);$i++)
{
$nbi='nb'.$i;
$liste[$i][1]=$HTTP_GET_VARS["$nbi"];//recup du nbr d'article dans la liste
$liste[$i][3]=$liste[$i][1]*$liste[$i][2];//prixArticle=nbre*prixUnitaire
}
$HTTP_SESSION_VARS['liste']=$liste;//mAj de la liste
}
//----------------------SUPP PANIER
if ($suppPanier==1)
{
$article=$HTTP_GET_VARS['suppPanier'];
for ($i=0;$i<count($liste);$i++)
{
if($article==$i)
array_splice($liste,$i,1);
//suppression de l'article
}
$HTTP_SESSION_VARS['liste']=$liste;//mAj de la liste
}

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Page panier</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<style type="text/css">
<!--
.style7 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #990000; font-weight: bold; }
.style11 {font-size: 11px}
.style12 {font-family: Arial, Helvetica, sans-serif; color: #990000;}
.style17 {font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #990000; font-weight: bolder; margin: 0px;}
.style20 {font-size: xx-small}
form{
margin: 0;
padding: 0;
}
a:link {
text-decoration: none;
color: #990000;
}
a:visited {
text-decoration: none;
color: #990000;
}
a:hover {
text-decoration: none;
color: #FFFFFF;
}
a:active {
text-decoration: none;
color: #990000;
}
.style22 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #990000; font-weight: bolder; margin: 0px; }
.style23 {color: #336600}
.style26 {
font-size: 12px;
font-weight: bold;
}
.style33 {color: #990000; font-size: 12px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; }
-->
</style>
</head>

<body bgcolor="#D3D678">
<div id="Layer1" style="position:absolute; width:745px; height:165px; z-index:9; left: 159px; top: 329px;">
<form action="panier.php" method="get" name="form1" target="_parent">
<table width="722" border="0" cellspacing="0" cellpadding="0" >
<tr bgcolor="#CCDF8A" class="style22">
<td width="4" height="29" bgcolor="#CCDF8A"><div align="center" class="style26"></div></td>
<td width="5" height="29" bgcolor="#CCDF8A">&nbsp;</td>
<td height="29" bgcolor="#CCDF8A"><div align="center"><span class="style26"><span class="style12">Reference du produit </span></span></div></td>
<td width="88" bgcolor="#CCDF8A"><div align="center" class="style26">
<div align="left"><span class="style12">Quantit&eacute;</span></div>
</div></td>
<td colspan="2" bgcolor="#CCDF8A"><div align="center" class="style26">
<div align="left"><span class="style12">Prix du produit </span></div>
</div></td>
<td width="69" bgcolor="#CCDF8A" class="style7"><div align="center" class="style26">Sous-total</div></td>
<td width="90" bgcolor="#CCDF8A">&nbsp;</td>
<td width="4" bgcolor="#CCDF8A">&nbsp;</td>
</tr>
<tr class="style20">
<td height="10" colspan="2">&nbsp;</td>
<td height="10">&nbsp;</td>
<td height="10">&nbsp;</td>
<td width="75" height="10">&nbsp;</td>
<td width="66" height="10">&nbsp;</td>
<td height="10">&nbsp;</td>
<td height="10">&nbsp;</td>
<td width="4" height="10">&nbsp;</td>
</tr>
<?php
$total=0.00; // initialisation du total de la commande à 0
for ($i=0;$i<count($liste);$i++)
{//début du bloc for
$query_rsPanier="select * from articles_rdt where Reference_article='".$liste[$i][0]."'";
$rsPanier=mysql_query($query_rsPanier, $ConnectionSiteRDT) or die(mysql_error());
$row_rsPanier=mysql_fetch_assoc($rsPanier);
/*définition et exécution de la requête SQL afin de récupérer les informations de l'article stocké dans la base(référence...)*/
?>
<tr bgcolor="#FFFF99">
<td width="4" height="20" bgcolor="#D3D678">&nbsp;</td>
<td width="5" height="20" bgcolor="#FFFF99">&nbsp;</td>
<td width="321" height="20" bgcolor="#FFFF99" class="style7 style11"><?php echo $row_rsPanier['Reference_article'] ?></td>
<td width="88" height="20" bgcolor="#FFFF99" class="style11"><select name="nb<?php echo $i ?>" class="style11" 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)
</select>
<?php if ($row_rsPanier['Quantite_article']=="les 100g")
{ echo "x 100g"; }?></td>
<td colspan="2" height="20" bgcolor="#FFFF99" class="style17"><div align="center"> <div align="left"><?php echo $row_rsPanier['PrixVenteTTC'] ?> € <?php echo $row_rsPanier['Quantite_article'] ?></div></td>
<td bgcolor="#FFFF99" height="20" class="style7"><div align="center" class="style11"><span class="none"><? echo $liste[$i][3] ?> </span>&euro; TTC</div></td>
<td bgcolor="#FFFF99" height="20" class="style17"><div align="center">
<div align="center"><a href="panier.php?article=<?php echo $i ?>&suppPanier=1">enlever du panier</a></div></td>
<td bgcolor="#D3D678" class="style17">&nbsp;</td>
</tr>
<tr class="style20">
<td colspan="3" >&nbsp;</td>
<td colspan="2" >&nbsp;</td>
<td colspan="2" >&nbsp;</td>
<td colspan="2" >&nbsp;</td>
</tr>
<tr>
<td colspan="3"><span class="style22">
<?php $total+=$row_rsPanier['PrixVenteTTC'] * $liste[$i][1];
}// fin du bloc for
?>
<strong>Total de votre commande <?php echo $total ?> &euro; TTC </strong></span></td>
<td colspan="2"><div align="right"></div>
<div align="right">
<input name="modifPanier" type="submit" class="style11" value="ACTUALISER">
</div></td>
<td colspan="2">
<div align="left">
<input name="enregistreCommande" type="submit" class="style11" value="COMMANDER">
</div></td>
<td colspan="2">&nbsp;</td>
</tr>
</table>
</form>
</div>
<div id="Layer8" style="position: absolute; align: center; left: 116px; top: 0px; width: 808px; height: 68px; z-index: 8; text-align: center;"><img src="../banniere_rdt.gif" width="810" height="70"></div>
<div id="Layer3" style="position:absolute; width:290px; height:20px; z-index:11; left: 139px; top: 152px;" class="style31">
<div align="center" class="style23 style23">
<div align="left" class="style33"><strong>Votre panier contient <?php echo $i ?> articles </strong></div>
</div>
</div>
Antoine
utilise les balises [ code] elles sont là pour ça wink.gif
coco1977
j' ai eu le meme cas que toi tu dois le faire en javascript
ton retour le header permet de faire le retour mais c'est
fonction ne fonctionne pas tres bien chez ton hebergeur
Donc il faut la faire en javascript.

Au lieu de mettre le header :
tu dois faire
tu met ça dans ton body pour faire le retour.
Ceci est une version "bas débit" de notre forum. Pour voir la version complète avec plus d'informations, la mise en page et les images, veuillez cliquer ici.
Invision Power Board © 2001-2009 Invision Power Services, Inc.