salut à tous
je suis en train de programmer en php (je suis debutant) et en ce moment je suis sur les sessions,et j'ai voulu tester un code pris sur un tuto concernant une boutique en ligne.
Mon problème est que lorsque je fais la mise en forme de ma page (car le code source est sans mise en forme de la page) il m'affiche les messages suivants:
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at f:\sitecommercial\panier4_1.php:11) in
f:\sitecommercial\panier4_1.php on line
82
Alors je ne comprends pas pourquoi cela s'affiche?je tiens à signaler aussi,que le code s'exécute normalement mais avec ce message partout!
Voici le code peut etre qu'il y a des choses que je ne dois pas faire.
Merci d'avance pour votre aide!
<?php
session_start();
if(isset($_SESSION['panier'])){
echo"<div align='right'><a href='Panier4_3.php'><b>VOIR CADDIE</b></a></div><br><br>";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
[ Lien ]">
<html>
<!-- DW6 -->
<head>
<title>Page d'accueil</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="mm_training.css" type="text/css">
<link rel="stylesheet" href="rudy.css" type="text/css">
</head>
<body bgcolor="#64748B">
<div id="conteneur">
<table width="50%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#26354A">
<td width="15" nowrap><img src="mm_spacer.gif" alt="" width="15" height="1" border="0"></td>
<td height="70" colspan="3" class="logo" nowrap><font size="+4"> MAROC PC </font><span class="tagline"><b>|L'informatque à la portée de tout le monde</b></span></td>
<td width="40"> </td>
<td width="100%"> </td>
</tr>
<tr bgcolor="#FF6600">
<td colspan="6"><img src="mm_spacer.gif" alt="" width="1" height="4" border="0"></td>
</tr>
<tr bgcolor="#D3DCE6">
<td colspan="6"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0"></td>
</tr>
<tr bgcolor="#FFCC00">
<td width="15" nowrap> </td>
<td width="705" colspan="3" height="24">
<table width="775" height="22" border="0" cellpadding="0" cellspacing="0" id="navigation">
<tr>
<td width="72" align="center" nowrap class="navText"><a href="accueil.html">ACCUEIL</a></td>
<td width="122" align="center" nowrap class="navText"><a href="clients.html">ESPACE CLIENTS</a></td>
<td width="109" align="center" nowrap class="navText"><a href="bc.html">NOS PRODUITS</a></td>
<td width="165" align="center" nowrap class="navText"><a href="connectfour.html">ESPACE FOURNISSEURS</a></td>
<td width="175" align="center" nowrap class="navText"><a href="connectadmin.html">ESPACE ADMINISTRATEUR</a></td>
<td width="130" align="center" nowrap class="navText"><a href="contact.html">CONTACTEZ-NOUS</a></td>
</tr>
</table> </td>
<td width="40"> </td>
<td width="50%"> </td>
</tr>
<tr bgcolor="#D3DCE6">
<td colspan="6"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0"></td>
</tr>
<tr bgcolor="#FF6600">
<td colspan="6"><img src="mm_spacer.gif" alt="" width="1" height="4" border="0"></td>
</tr>
</table> </td>
<td width="50" valign="top"><img src="mm_spacer.gif" alt="" width="50" height="1" border="0"></td>
<td width="440" valign="top"><br>
<br> <br>
<br> </td>
<td width="40"> </td>
<td width="100%"> </td>
</tr>
<tr bgcolor="#FF6600">
<td colspan="6"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0"></td>
</tr>
<tr>
<td width="15"> </td>
<td width="215"> </td>
<td width="50"> </td>
<td width="440"> </td>
<td width="40"> </td>
<td width="100%"> </td>
</tr>
</table>
<H1 align="center">Votre Boutique en ligne ....</H1>
<table border="1" bgcolor="cccccc" align="center" width="50%">
<tr bgcolor='white'>
<td width="" align="center">Produits</td>
<td width="" align="center">Prix Final TTC Unitaire</td>
<td width=""> </td>
</tr>
<?
if(!isset($_GET['prod'])){
require('inc_connect.php');
$sql="Select* from materiel";
$req=mysql_query($sql,$connexion)or exit ('Erreur SQL !'.$sql.'<br>'.mysql_error());
while( $data=mysql_fetch_array($req) ) {
echo"<tr><td>".$data['DESIGNATION']." </td><td> ".$data['PRIXFINALTTC']."</td><td> <a href='panier4_1.php?prod=".$data['id']."'>Ajouter au Panier</a></td></tr>";
}
mysql_close();
?>
</table>
<?}
if(isset($_GET['prod'])){
if(!is_numeric($_GET['prod'])){//juste une première sécurité
echo"<font color='red'>MERCI DE NE PLUS RECOMMENCER CETTE OPERATION !!!</font>";
exit;
}
require('inc_connect.php');
$sql1="Select* from materiel where id=".$_GET['prod'];
$req1=mysql_query($sql1,$connexion)or exit ('Erreur SQL !'.$sql1.'<br>'.mysql_error());
$nb=mysql_num_rows($req1);
if($nb==0){//juste une seconde sécurité
echo" <font color='red'>MERCI DE NE PLUS RECOMMENCER CETTE OPERATION !!!</font>";
exit;
}
//afichage du Produit séléctionné avec qté à commander:
while( $data=mysql_fetch_array($req1) ) {
?>
<form method="POST" action="Panier4_2.php">
<?
echo"<tr><td>".$data['DESIGNATION']." </td><td colspan='2'> ".$data['PRIXFINALTTC']."</td></tr>".
"<tr><td colspan='3'align='center'>Quantité : <input type='text' name='qte' size='5'> <input type='submit' name='action' value='Commander'></td></tr>".
"<input name='id' type='hidden' value='".$data['id']."'>";
}
mysql_close();
?>
</table><br>
<div align="center"><a href="history.go(-1)">< Retour Boutique</a></div>
</form>
<?
}
?>
</div>
</body>
</html>