erreur T_else

Eléphant du PHP | 450 Messages

23 juin 2005, 10:00

Bonjour vous tous ,

J'ais cette erreur dans mon code
Parse error: parse error, unexpected T_ELSE in /data/htdocs2/Webdav_depot/enscr/intranet_enscr/intranet_enscr_personnel/intranet_lsab/maj.php on line 225
et j'aimerais savoir de quoi il s'agit??

(je c'est pas ou on regarde pour savoir : //

merci de em repondre :P
Alone in the dark , I smile :D

Eléphant du PHP | 419 Messages

23 juin 2005, 10:02

castelli tu peux montrer ton code de ta page maj.php pas forcement tout autour de la ligne 225 si c'est la dernière montre tout

Eléphant du PHP | 450 Messages

23 juin 2005, 10:09

Je veut bien mais il y ' a pas mal de ligne :) :P

(ps : le code vient d'un formulaire de cyrano que j'ais pris pour adapter a mes besoins :) voila lol )
<body>
<?php 

$host = '*****'; 
$user = '*****'; 
$pass = '*****'; 
$db = '*****';

// connection à la DB
$link = mysql_connect ($host,$user,$pass) or die ('Erreur : '.mysql_error() );
mysql_select_db($db) or die ('Erreur :'.mysql_error());



$id =$_GET['id'];

$select = "SELECT * FROM produit2 WHERE reference LIKE '$id'";
$result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
$row = mysql_fetch_assoc($result);

$nom = 'nom';
$formule = 'formule';
$reference = 'reference';
$num = $row['numero_cass'];

if(isset($_POST['envoi']))
	{
$quantite=$_POST['quantite'];
$fournisseur = $_POST['fournisseur'];
$nombre_quantite=$_POST['nombre_quantite'];
$prix=$_POST['prix'];
$date = date("d-m");

if ($prix == '' || $nombre_quantite == '' || $quantite == '' || $fournisseur == '')
			{
?>
				<h3>Informations incomplètes</h3>
				<p>Un (ou plusieurs) champ(s) n'a(ont) pas été correctement rempli(s).</p>
        <ol>
<?php
				if ($prix == '') // Si le champ "prix" est vide,
					{	print "<li>Vous n'avez pas précisé le prix de la molecule</li>\n";}
				if ($quantite == '') // Si le champ "quantite" est vide,
					{	print "<li>Vous n'avez pas précisé la quantite de molecule par lot</li>\n";}
				if ($nombre_quantite == '') // Si le champ "nombre_quantite" est vide,
					{ print "<li>Vous n'avez pas précisé le nombre de lot de molecule a commander</li>\n";}
				if ($fournisseur == '')  // Si le champ "fournisseur" est vide,
					{	print "<li>Vous n'avez pas précisé le fournisseur pour ce produit</li>\n";}
				
?>
        </ol>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
  <table summary="">
    <col width="250" title="titres" />
    <col width="15" title="oblige" />
    <col width="250" title="donnees" />
<tr width="30%" height="15"><td><b>Nom de la molécule :</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php ".$row['nom']." ?></b></td></tr>
<tr width="30%" height="29"><td><b>Formule brute de la molecule:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php".$row['formule']."?></b></td></tr>
<tr width="30%" height="29"><td><b>Localisation de la Molécule:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php".$row['localisation']."?></b></td></tr>
<tr width="30%" height="29"><td><b>Disponibilité :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold"></div></td>
<td><b><?php".$row['disponibilite']."?></b></td></tr>
<tr width="30%" height="15"><td><b>Quantité en reserve :</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><input type="text" name="quantite"></b></td></tr>
<tr width="30%" height="29"><td><b>Reference de la molecule:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php".$row['reference']."?></b></td></tr>
<tr width="30%" height="29"><td><b>Numero de CAS:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php".$row['numero_cass']."?></b></td></tr>
<tr width="30%" height="29"><td><b>Toxicite :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold"></div></td>
<td><b><?php".$row['toxicite']."?></b></td></tr>
<tr width="30%" height="29"><td><b>Fournisseur:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold">*</div></td>
<td width="30%" height="29"><select name="fournisseur">
<option value="acros">Acros</option>
<option value="aldricht">Aldricht</option>
<option value="sigma">Sigma</option>
<option value="lancaster">Lancaster</option>
<option value="sigma">Fluka</option>
<option value="lancaster">Strem</option>
<option value="autres">autres</option>
</select></td>
<tr width="30%" height="29"><td><b>Autres Fournisseur:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><input type="text" name="nouveau_fournisseur"></b></td></tr>
<tr width="30%" height="29"><td><b>Quantité unitaire :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold">*</div></td>
<td><b><input type="text" name="quantite"></b></td></tr>
<tr width="30%" height="29"><td><b>Nombres d'unités:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold">*</div></td>
<td><b><input type="text" name="nombre_quantite"></b></td></tr>
<tr width="30%" height="29"><td><b>Prix unitaire :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold">*</div></td>
<td><b><input type="text" name="prix">€</b></td></tr>
<tr><td colspan="3"><div style="text-align:center;"><input type="submit" class="verif" name="envoi" value="Envoyer" />&nbsp;
<input type="reset" class="verif" value="Tout effacer" /><input type="submit" value="Imprimer" onclick="print();"></div></td></tr>

</TABLE></form>
<?php		
			}
		else
			{

			print "<h3>Merci ! Voici les informations que vous avez fournies</h3>\n";
				print "<p>Informations sur la nouvelle molecule:</p>\n";
				print "<b>Son nom :</b>".$nom."<br />\n";
				print "<b>Sa formule Brute :</b>".$formule."<br />\n";
				print "<b>Sa localisation :</b>".$localisation."<br />\n";
				print "<b>Sa quantite en reserve :</b>".$quantite."<br />\n";
				print "<b>Sa reference :</b>".$reference."<br />\n";
				print "<b>Son numero de CAS :</b>".$numero_cass."<br />\n";
			if ($toxicite !==''){
				print "<b>Sa toxicite s'il y en a une :</b> ".$toxicite."<br />\n";}
				print "<b>Son fournisseur :</b>".$fournisseur."<br />\n";
				print "<b>Sa Quantité unitaire :</b>".$quantite."<br />\n";
				print "<b>Le nombre d'unité a commander :</b>".$nombre_quantite."<br />\n";
				print "<b>Son Prix :</b>".$prix."<br />\n";		
        print("<p>Retour vers l'index de recherche, cliquez <a href=\"recherche.php\" title=\"Retour vers le formulaire de recherche\">ICI</a></p>");
	print("<p>Retour vers l'Index, cliquez <a href=\"index.html\" title=\"Retour a l'index\">ICI</a></p>");
			

$host = '****'; 
$user = '****'; 
$pass = '****'; 
$db = '****';

// connection à la DB
$link = mysql_connect ($host,$user,$pass) or die ('Erreur : '.mysql_error() );
mysql_select_db($db) or die ('Erreur :'.mysql_error());

$fournisseur='';
if(isset($_POST['nouveau_fournisseur'])){
        if(strcmp($_POST['nouveau_fournisseur'],'')!=0){
                $fournisseur=$_POST['nouveau_fournisseur'];
        }else{
                $fournisseur=$_POST['fournisseur'];
        }
}

$select2 = "SELECT * FROM produit2 WHERE reference LIKE '$id'";
$result2 = mysql_query($select2,$link) or die ('Erreur : '.mysql_error() );
$row2 = mysql_fetch_assoc($result2);
$nom2 = $row2['nom'];
$numero_cass2 = $row2['numero_cass'];


$fournisseur = addslashes($fournisseur);
$quantite = addslashes($quantite);
$nombre_quantite= addslashes($nombre_quantite);
$prix= addslashes($prix);
$numero_cass2= addslashes($numero_cass2);
$nom2= addslashes($nom2);
$date= addslashes($date); 

if(($quantite !="")&&($prix !="")&&($nombre_quantite !=""))
{
$query="INSERT INTO commande (fournisseur,quantite,nombre_quantite,prix,numero_cass,nom,date) VALUES ('".$fournisseur."', '".$quantite."', '".$nombre_quantite."', '".$prix."','".$numero_cass2."','".$nom2."','".$date."');"; 
mysql_query($query) or die (mysql_error);
			}
	}
/* Si cette page s'ouvre pour la première fois sans que le bouton soumettant le formulaire n'ait 
   été cliqué, alors on affiche le formulaire normalement */
else
	{
?>
<H3><strong>Formulaire de commande de produits</strong></H3>
<p>Notez que les champs précédés d'une <span style="color: #ff0000; text-align: center; font-weight: bold">*</span> doivent obligatoirement être remplis.</p>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
  <table summary="">
    <col width="250" title="titres" />
    <col width="15" title="oblige" />
    <col width="250" title="donnees" />
<tr width="30%" height="15"><td><b>Nom de la molécule :</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php ".$row['nom']." ?></b></td></tr>
<tr width="30%" height="29"><td><b>Formule brute de la molecule:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php".$row['formule']."?></b></td></tr>
<tr width="30%" height="29"><td><b>Localisation de la Molécule:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php".$row['localisation']."?></b></td></tr>
<tr width="30%" height="29"><td><b>Disponibilité :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold"></div></td>
<td><b><?php".$row['disponibilite']."?></b></td></tr>
<tr width="30%" height="15"><td><b>Quantité en reserve :</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><input type="text" name="quantite"></b></td></tr>
<tr width="30%" height="29"><td><b>Reference de la molecule:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php".$row['reference']."?></b></td></tr>
<tr width="30%" height="29"><td><b>Numero de CAS:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php".$row['numero_cass']."?></b></td></tr>
<tr width="30%" height="29"><td><b>Toxicite :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold"></div></td>
<td><b><?php".$row['toxicite']."?></b></td></tr>
<tr width="30%" height="29"><td><b>Fournisseur:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold">*</div></td>
<td width="30%" height="29"><select name="fournisseur">
<option value="acros">Acros</option>
<option value="aldricht">Aldricht</option>
<option value="sigma">Sigma</option>
<option value="lancaster">Lancaster</option>
<option value="sigma">Fluka</option>
<option value="lancaster">Strem</option>
<option value="autres">autres</option>
</select></td>
<tr width="30%" height="29"><td><b>Autres Fournisseur:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><input type="text" name="nouveau_fournisseur"></b></td></tr>
<tr width="30%" height="29"><td><b>Quantité unitaire :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold">*</div></td>
<td><b><input type="text" name="quantite"></b></td></tr>
<tr width="30%" height="29"><td><b>Nombres d'unités:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold">*</div></td>
<td><b><input type="text" name="nombre_quantite"></b></td></tr>
<tr width="30%" height="29"><td><b>Prix unitaire :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold">*</div></td>
<td><b><input type="text" name="prix">€</b></td></tr>
<tr><td colspan="3"><div style="text-align:center;"><input type="submit" class="verif" name="envoi" value="Envoyer" />&nbsp;
<input type="reset" class="verif" value="Tout effacer" /><input type="submit" value="Imprimer" onclick="print();"></div></td></tr>

</TABLE></form>
<?php
	}
?>
</BODY>
Alone in the dark , I smile :D

Eléphant du PHP | 260 Messages

23 juin 2005, 10:10

En plus tu le sais qu'il faut montrer son code :D

Boulet ! no comment ! La vengeance est un plat qui se mange froid ! :langue:
Mon jeu : http://www.battle-stars.fr.tc
---
Mon serveur : http://servlan.dyndns.org
---
Bientôt tous mes serveurs OPEN ;)

Eléphant du PHP | 450 Messages

23 juin 2005, 10:13

Mais euhh... :lol:

je crois qu'il y'a pas mal d'erreur ... surtout o niveau des tableaux avec les
<?php ".$row['nom']." ?>
:?

nan? lol

edit 1 : désolé pour le code aussi long :?
Alone in the dark , I smile :D

Eléphant du PHP | 419 Messages

23 juin 2005, 10:16

ba euh j'en sais rien apparement il doit y avoir une erreur ligne 225 dû au else de la ligne 172 mais je peux pas t'en dire et je pense que t'avais déjà compris ça

Eléphant du PHP | 450 Messages

23 juin 2005, 10:20

bon bah je vais continuer de chercher alors :)

merci encore "saucice"

ps : sa veut dire koi parse error t_else ?
(erreur o nivo de else :roll: ?? lol )
Alone in the dark , I smile :D

Eléphant du PHP | 260 Messages

23 juin 2005, 10:25

Dès fois sa affiche ce message a cause d'une accolade manquante ou pour un parenthèse foireuse ! :o
Mon jeu : http://www.battle-stars.fr.tc
---
Mon serveur : http://servlan.dyndns.org
---
Bientôt tous mes serveurs OPEN ;)

Eléphant du PHP | 260 Messages

23 juin 2005, 10:32

Dis moi, quand tu écris sa :
<?php ".$row['nom']." ?>
il ne manquerait pas un print dès fois ou meme un point virgule :? , du style :
<?php print $row['nom']; ?>
:? :?
Mon jeu : http://www.battle-stars.fr.tc
---
Mon serveur : http://servlan.dyndns.org
---
Bientôt tous mes serveurs OPEN ;)

Eléphant du PHP | 450 Messages

23 juin 2005, 10:38

lol sisisi :) j'ais remarquer :) (mais sa sa prend juste deux minute a corriger et comme c pas la source de mon erreur ...)
C'est pas se qui m'importe le plus en ce moment :) lol
Alone in the dark , I smile :D

Eléphant du PHP | 260 Messages

23 juin 2005, 10:41

et sa marche toujours pas ?? alors édite ton code de dessus et met le a jour STP !
Mon jeu : http://www.battle-stars.fr.tc
---
Mon serveur : http://servlan.dyndns.org
---
Bientôt tous mes serveurs OPEN ;)

Eléphant du PHP | 450 Messages

23 juin 2005, 10:46

Voila c bon il est edité :)

<body>
<?php 

$host = '****'; 
$user = '****'; 
$pass = ***'; 
$db = '***';

// connection à la DB
$link = mysql_connect ($host,$user,$pass) or die ('Erreur : '.mysql_error() );
mysql_select_db($db) or die ('Erreur :'.mysql_error());

$id =$_GET['id'];

$select = "SELECT * FROM produit2 WHERE reference LIKE '$id'";
$result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
$row = mysql_fetch_assoc($result);

$nom = 'nom';
$formule = 'formule';
$reference = 'reference';
$num = $row['numero_cass'];
$nom1 = $row['nom'];

if(isset($_POST['envoi']))
	{
$quantite=$_POST['quantite'];
$fournisseur = $_POST['fournisseur'];
$nombre_quantite=$_POST['nombre_quantite'];
$prix=$_POST['prix'];
$date = date("d-m");

if ($prix == '' || $nombre_quantite == '' || $quantite == '' || $fournisseur == '')
			{
?>
				<h3>Informations incomplètes</h3>
				<p>Un (ou plusieurs) champ(s) n'a(ont) pas été correctement rempli(s).</p>
        <ol>
<?php
				if ($prix == '') // Si le champ "prix" est vide,
					{	print "<li>Vous n'avez pas précisé le prix de la molecule</li>\n";}
				if ($quantite == '') // Si le champ "quantite" est vide,
					{	print "<li>Vous n'avez pas précisé la quantite de molecule par lot</li>\n";}
				if ($nombre_quantite == '') // Si le champ "nombre_quantite" est vide,
					{ print "<li>Vous n'avez pas précisé le nombre de lot de molecule a commander</li>\n";}
				if ($fournisseur == '')  // Si le champ "fournisseur" est vide,
					{	print "<li>Vous n'avez pas précisé le fournisseur pour ce produit</li>\n";}
				
?>
        </ol>


<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
  <table summary="">
    <col width="250" title="titres" />
    <col width="15" title="oblige" />
    <col width="250" title="donnees" />
<tr width="30%" height="15"><td><b>Nom de la molécule :</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php  print $nom1; ?></b></td></tr>
<tr width="30%" height="29"><td><b>Formule brute de la molecule:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['formule']; ?></b></td></tr>
<tr width="30%" height="29"><td><b>Localisation de la Molécule:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['localisation']; ?></b></td></tr>
<tr width="30%" height="29"><td><b>Disponibilité :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['disponibilite']; ?></b></td></tr>
<tr width="30%" height="15"><td><b>Quantité en reserve :</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['quantite']; ?></b></td></tr>
<tr width="30%" height="29"><td><b>Reference de la molecule:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['reference']; ?></b></td></tr>
<tr width="30%" height="29"><td><b>Numero de CAS:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['numero_cass']; ?></b></td></tr>
<tr width="30%" height="29"><td><b>Toxicite :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['toxicite']; ?></b></td></tr>

<tr width="30%" height="29"><td><b>Fournisseur:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold">*</div></td>
<td width="30%" height="29"><select name="fournisseur">
<option value="acros">Acros</option>
<option value="aldricht">Aldricht</option>
<option value="sigma">Sigma</option>
<option value="lancaster">Lancaster</option>
<option value="sigma">Fluka</option>
<option value="lancaster">Strem</option>
<option value="autres">autres</option>
</select></td>
<tr width="30%" height="29"><td><b>Autres Fournisseur:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><input type="text" name="nouveau_fournisseur"></b></td></tr>
<tr width="30%" height="29"><td><b>Quantité unitaire :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold">*</div></td>
<td><b><input type="text" name="quantite"></b></td></tr>
<tr width="30%" height="29"><td><b>Nombres d'unités:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold">*</div></td>
<td><b><input type="text" name="nombre_quantite"></b></td></tr>
<tr width="30%" height="29"><td><b>Prix unitaire :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold">*</div></td>
<td><b><input type="text" name="prix">€</b></td></tr>

<tr><td colspan="3"><div style="text-align:center;"><input type="submit" class="verif" name="envoi" value="Envoyer" />&nbsp;
<input type="reset" class="verif" value="Tout effacer" /><input type="submit" value="Imprimer" onclick="print();"></div></td></tr>

</TABLE></form>
<?php		
			}
		else
			{

				print "<h3>Merci ! Voici les informations que vous avez fournies</h3>\n";
				print "<p>Informations sur la nouvelle molecule:</p>\n";
				print "<b>Son nom :</b>".$nom."<br />\n";
				print "<b>Sa formule Brute :</b>".$formule."<br />\n";
				print "<b>Sa localisation :</b>".$localisation."<br />\n";
				print "<b>Sa quantite en reserve :</b>".$quantite."<br />\n";
				print "<b>Sa reference :</b>".$reference."<br />\n";
				print "<b>Son numero de CAS :</b>".$numero_cass."<br />\n";
			if ($toxicite !==''){
				print "<b>Sa toxicite s'il y en a une :</b> ".$toxicite."<br />\n"; 
						}
				print "<b>Son fournisseur :</b>".$fournisseur."<br />\n";
				print "<b>Sa Quantité unitaire :</b>".$quantite."<br />\n";
				print "<b>Le nombre d'unité a commander :</b>".$nombre_quantite."<br />\n";
				print "<b>Son Prix :</b>".$prix."<br />\n";		
        print("<p>Retour vers l'index de recherche, cliquez <a href=\"recherche.php\" title=\"Retour vers le formulaire de recherche\">ICI</a></p>");
	print("<p>Retour vers l'Index, cliquez <a href=\"index.html\" title=\"Retour a l'index\">ICI</a></p>");
			

$host = '***'; 
$user = '***'; 
$pass = '***'; 
$db = '***';

// connection à la DB
$link = mysql_connect ($host,$user,$pass) or die ('Erreur : '.mysql_error() );
mysql_select_db($db) or die ('Erreur :'.mysql_error());

$fournisseur='';
   if(isset($_POST['nouveau_fournisseur']))			{
        if(strcmp($_POST['nouveau_fournisseur'],'')!=0)			{
                $fournisseur=$_POST['nouveau_fournisseur'];
        								}else{
                $fournisseur=$_POST['fournisseur'];
       									 }
								}



 
$select2 = "SELECT * FROM produit2 WHERE reference LIKE '$id'";
$result2 = mysql_query($select2,$link) or die ('Erreur : '.mysql_error() );
$row2 = mysql_fetch_assoc($result2);
$nom2 = $row2['nom'];
$numero_cass2 = $row2['numero_cass'];


$fournisseur = addslashes($fournisseur);
$quantite = addslashes($quantite);
$nombre_quantite= addslashes($nombre_quantite);
$prix= addslashes($prix);
$numero_cass2= addslashes($numero_cass2);
$nom2= addslashes($nom2);
$date= addslashes($date); 

if(($quantite !="")&&($prix !="")&&($nombre_quantite !=""))
{
$query="INSERT INTO commande (fournisseur,quantite,nombre_quantite,prix,numero_cass,nom,date) VALUES ('".$fournisseur."', '".$quantite."', '".$nombre_quantite."', '".$prix."','".$numero_cass2."','".$nom2."','".$date."');"; 
mysql_query($query) or die (mysql_error);
			}
	}
else
	{
?>
<H3><strong>Formulaire de commande de produits</strong></H3>
<p>Notez que les champs précédés d'une <span style="color: #ff0000; text-align: center; font-weight: bold">*</span> doivent obligatoirement être remplis.</p>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
  <table summary="">
    <col width="250" title="titres" />
    <col width="15" title="oblige" />
    <col width="250" title="donnees" />
<tr width="30%" height="15"><td><b>Nom de la molécule :</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php  print $nom1; ?></b></td></tr>
<tr width="30%" height="29"><td><b>Formule brute de la molecule:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['formule']; ?></b></td></tr>
<tr width="30%" height="29"><td><b>Localisation de la Molécule:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['localisation']; ?></b></td></tr>
<tr width="30%" height="29"><td><b>Disponibilité :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['disponibilite']; ?></b></td></tr>
<tr width="30%" height="15"><td><b>Quantité en reserve :</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['quantite']; ?></b></td></tr>
<tr width="30%" height="29"><td><b>Reference de la molecule:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['reference']; ?></b></td></tr>
<tr width="30%" height="29"><td><b>Numero de CAS:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['numero_cass']; ?></b></td></tr>
<tr width="30%" height="29"><td><b>Toxicite :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['toxicite']; ?></b></td></tr>

<tr width="30%" height="29"><td><b>Fournisseur:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold">*</div></td>
<td width="30%" height="29"><select name="fournisseur">
<option value="acros">Acros</option>
<option value="aldricht">Aldricht</option>
<option value="sigma">Sigma</option>
<option value="lancaster">Lancaster</option>
<option value="sigma">Fluka</option>
<option value="lancaster">Strem</option>
<option value="autres">autres</option>
</select></td>
<tr width="30%" height="29"><td><b>Autres Fournisseur:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><input type="text" name="nouveau_fournisseur"></b></td></tr>
<tr width="30%" height="29"><td><b>Quantité unitaire :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold">*</div></td>
<td><b><input type="text" name="quantite"></b></td></tr>
<tr width="30%" height="29"><td><b>Nombres d'unités:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold">*</div></td>
<td><b><input type="text" name="nombre_quantite"></b></td></tr>
<tr width="30%" height="29"><td><b>Prix unitaire :</b></td>
<td><div style="color: #ffffff; text-align: center; font-weight: bold">*</div></td>
<td><b><input type="text" name="prix">€</b></td></tr>

<tr><td colspan="3"><div style="text-align:center;"><input type="submit" class="verif" name="envoi" value="Envoyer" />&nbsp;
<input type="reset" class="verif" value="Tout effacer" /><input type="submit" value="Imprimer" onclick="print();"></div></td></tr>

</TABLE></form>

<?php
	}
?>
</BODY>
Alone in the dark , I smile :D

Eléphant du PHP | 260 Messages

23 juin 2005, 10:50

Tu aurais pu re-éditer ton code de dessus au lieu de pondre encore une page code !
La guillement manquante au niveau de $pass c'est normal ?
Tu m'a donné toutes la page en entier ?

EDIT 1 > il te manque une accolade a la ligne 32 !

EDIT 2 > ton if (essaye) :
if (($prix == '') || ($nombre_quantite == '') || ($quantite == '') || ($fournisseur == ''))
[/php]
Mon jeu : http://www.battle-stars.fr.tc
---
Mon serveur : http://servlan.dyndns.org
---
Bientôt tous mes serveurs OPEN ;)

Eléphant du PHP | 450 Messages

23 juin 2005, 10:58

Pour l'accolade de la ligne 32 , tu la retrouve juste avant le dernier else (avant le second tableau )
Donc c 'est normale :)

(sinon pour l'acolade c moi qui ait fait une erreur en recopiant

pardon :oops: :oops:

(escuse pour l'edition :oops: )

Pour verifier que sa venait pas du If
if(($quantite !="")&&($prix !="")&&($nombre_quantite !=""))
{
$query="INSERT INTO commande (fournisseur,quantite,nombre_quantite,prix,numero_cass,nom,date) VALUES ('".$fournisseur."', '".$quantite."', '".$nombre_quantite."', '".$prix."','".$numero_cass2."','".$nom2."','".$date."');"; 
mysql_query($query) or die (mysql_error);

echo $query;
}
J'ais virer cette condition .. et sa marche pas mieu : //

arghh
Modifié en dernier par castelli le 23 juin 2005, 11:00, modifié 1 fois.
Alone in the dark , I smile :D

Modérateur PHPfrance
Modérateur PHPfrance | 6373 Messages

23 juin 2005, 10:59

cette erreu c'est tout simplement un else en trop

si j'ai bien suivi ton code, cela vient d'ici :
if(($quantite !="")&&($prix !="")&&($nombre_quantite !=""))
{
$query="INSERT INTO commande (fournisseur,quantite,nombre_quantite,prix,numero_cass,nom,date) VALUES ('".$fournisseur."', '".$quantite."', '".$nombre_quantite."', '".$prix."','".$numero_cass2."','".$nom2."','".$date."');";
mysql_query($query) or die (mysql_error);
            }
    }
else
    {
?>
tu ouvres un else, alors que le code précédent est déjà dans un else

il ne peut y avoir deux else pour un if ;)