Parse error

Fermé
naturhair - 27 sept. 2006 à 22:44
jisisv Messages postés 3645 Date d'inscription dimanche 18 mars 2001 Statut Modérateur Dernière intervention 15 janvier 2017 - 28 sept. 2006 à 09:14
Je galère sur le code d'un script (e-commerce) que j'ai téléchargé sur le net. j'ai essayé de modifier afin le scripts à mon site.
j'arrive pas à voir ma page via le net et j'ai ce message d'erreur qui apparaît
"Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in /var/www/vhost/naturhair.com/home/html/Projet/boutique.php on line 38"

J'ai vraiment besoin de votre aide car je suis vraiment pas bien calé ds la programmation


<?php
include("variables.inc.php");
session_start();
?>
<html>
<head>
<title>Boutique Naturhair</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="Style/menu_haut.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="204" valign="top"><table width="204" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="Interface/produits.gif" width="204" height="30"></td>
</tr>
</table>
<?php
$liendb = mysql_connect('localhost','naturhair','essai');
mysql_select_db ('qbm739');
if (!isset($id)) $id = 1;

$sql = "SELECT * FROM $table_produit";
$resultat = mysql_query ($sql);

while ($produit = mysql_fetch_array ($resultat))
{
print(" - <a href=$PHP_SELF?id=" . $produit['idproduit'] . ">" . $produit['nom']
. "</a></br>");
}
?>
</td>
<td align="left" valign="top">

<?php
if (!isset(id)) $id = 1;
$sql = "SELECT * FROM $table_produit WHERE idproduit = '$id'";
$resultat = mysql_query ($sql);

$produit = mysqlfetch_array ($resultat);

echo $produit['nom'] . " <font class=reference>[ref#"
. $produit['reference'] . "]</font><br>";
echo $produit['photo'] . " <font class=photo>[ref#"
. $produit['photo'] . "]</font><br>";

echo "<p class=description" . n12br($produit['description']). "</p>";
echo $produit['prix'] . "€";

mysql_close($liendb);

?>
<p align=right>
<form action="ajout_caddie.php" method"post">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<input type="submit" class="unnamed2" value="ajouter au panier">
</form>
</p>
<?php

if (issset($monpanier))
{
print("<table width="900" border=0><tr><td align=center class=description>";
$tab = split(",",$monpannier);
$nb_prod = sizeof($tab) - 1;
print("<br>votre panier contient" . $nb_prod . " produit(s)<br>);
print("<form action=voir_caddie.php method=post>");
print("<input type=submit value='valider la commande'></form>");
print("cookie = {" . implode(",",$monpannier) . "}");
print("</td></tr></table>");
}
?>
</td> <p> </p> <p> </p>
<p> </p>
</tr>
</table>
</body>
</html>

1 réponse

jisisv Messages postés 3645 Date d'inscription dimanche 18 mars 2001 Statut Modérateur Dernière intervention 15 janvier 2017 934
28 sept. 2006 à 09:14
<?php
if (!isset($id)) $id = 1;
$sql = "SELECT * FROM $table_produit WHERE idproduit = '$id'"; 
//=========================================
if (issset($monpanier))
{
print("<table width=\"900\" border=\"0\"><tr><td align=\"center\" class=\"description\">");
$tab = split(",",$monpannier);


etc...
Utilise php en ligne de commande avec l'option -l
johan@johan:~/temp$ php -l brol.php

Parse error: parse error, unexpected T_STRING in brol.php on line 69
Errors parsing brol.php
De proche en proche tu auras un code syntactiquement correct.

Johan
0