Parse error: syntax error, unexpected $end in
Résolu/Fermé
A voir également:
- Parse error: syntax error, unexpected $end in
- Eespt technical error ✓ - Forum TNT / Satellite / Réception
- Error 0x80070643 - Accueil - Windows
- Fan error lenovo - Forum Refroidissement
- Cpu over temperature error - Forum Matériel & Système
- A disk read error occurred ✓ - Forum Windows
3 réponses
Polux31
Messages postés
6917
Date d'inscription
mardi 25 septembre 2007
Statut
Membre
Dernière intervention
1 novembre 2016
1 204
18 mars 2008 à 19:17
18 mars 2008 à 19:17
bonjour,
c'est tout ce que tu as comme info ??? tu dois avoir un numéro de ligne dans le message d'erreur ... parce que là :-s
c'est tout ce que tu as comme info ??? tu dois avoir un numéro de ligne dans le message d'erreur ... parce que là :-s
Bonjour,
Merci de ta reponse,
la ligne indiqué est la dernière, mais j'ai trouvé l'accolade manquante :
<?php
require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_check = tep_db_fetch_array($product_check_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
if ($product_check['total'] < 1) {
?>
<tr>
<td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<?php
} else {
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_info = tep_db_fetch_array($product_info_query);
tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
}
Merci de ta reponse,
la ligne indiqué est la dernière, mais j'ai trouvé l'accolade manquante :
<?php
require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_check = tep_db_fetch_array($product_check_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
if ($product_check['total'] < 1) {
?>
<tr>
<td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<?php
} else {
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_info = tep_db_fetch_array($product_info_query);
tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
}
Bonjour!
J'ai moi aussi le même problème avec la "syntax error, unexpected $end", et j'ai beau chercher, je ne trouve pas... Je suis dessus depuis hier, je ne trouve personne capable de m'aider et je désespère du coup je viens vous voir!
moviepage.php
J'ai l'impression que l'erreur vient de cette ligne
Mais je n'arrive pas à la corriger.
Un grand merci pour votre aide!!
J'ai moi aussi le même problème avec la "syntax error, unexpected $end", et j'ai beau chercher, je ne trouve pas... Je suis dessus depuis hier, je ne trouve personne capable de m'aider et je désespère du coup je viens vous voir!
moviepage.php
<style type="text/css"> <!--#fullinfobox{position:absolute;top:10px;left:200px;background-color:#99ccff;width:200px;border:dashed;border-width:1px;padding:10px}--> </style> <script language="Javascript"><!-- function getinfo(director_name) { //begin AJAX var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { fullinfobox.style.display="block" fullinfobox.innerHTML=xmlHttp.responseText;//reprint text on screen } } var url="getsuggestions.php?director_id="+director_id; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function clearit() { fullinfobox.innerHTML="" fullinfobox.style.display="none" } --></script> <?php // on se connecte à MySQL $db = mysql_connect('localhost', 'root', ''); // on sélectionne la base mysql_select_db('movie',$db); include("getsuggestions.php"); $id2=$_GET["dirid"]; $query2=("SELECT * FROM movie,directors WHERE director_id=dirid AND movie_id=$id2") or die (mysql_error()); $result=mysql_query($query) or die("Couldnt"); while ($r=mysql_fetch_array($result)) { ?> <a href='directorspage.php?directorid=".$id2."' onmouseover="javascript:getinfo('<?echo $r["director_id"];?>')" onmouseout="javascript:clearit()"><?echo $r["movie_name"];?> </a><br>; <? } ?> <span id="fullinfobox" style="display:none"></span> <div id="mytable"> <table border="1"> <a href="javascript:getdata('surname')">Director Name</a> <? while ($r=mysql_fetch_array($result)) { ?> <td><?echo $r["director_name"];?></td> <? } ?>
J'ai l'impression que l'erreur vient de cette ligne
<a href='directorspage.php?directorid=".$id2."' onmouseover="javascript:getinfo('<?echo $r["director_id"];?>')" onmouseout="javascript:clearit()"><?echo $r["movie_name"];?> </a><br>;
Mais je n'arrive pas à la corriger.
Un grand merci pour votre aide!!
Bonjour,
Essaye de remplacer cette ligne :
par celle là :
Ca devrait normalement marché.
Essaye de remplacer cette ligne :
<a href='directorspage.php?directorid=".$id2."' onmouseover="javascript:getinfo('<?echo $r["director_id"];?>')" onmouseout="javascript:clearit()"><?echo $r["movie_name"];?> </a><br>;
par celle là :
<a href='directorspage.php?directorid=".$id2."' onmouseover="javascript:getinfo('<?php echo $r["director_id"]; ?>')" onmouseout="javascript:clearit()"><?php echo $r["movie_name"]; ?> </a><br>;
Ca devrait normalement marché.
Bonjour, j'ai un probleme avec mon code php
Parse error: syntax error, unexpected $end in C:\EasyPHP-5.3.9\www\forum_ECHANGE\afficher_commentaire.php on line 148
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<meta charset="utf-8" />
<title>Sujet</title>
</head>
<body>
<!-- Page Global -->
<div id="global">
<!-- menu -->
<?php include("includes/menu.php"); ?>
<!-- en-tete -->
<?php include("includes/en_tete.php"); ?>
<!-- section -->
<div id="section">
<!-- navigation -->
<?php include("includes/navigation.php"); ?>
<!-- article -->
<div class="article">
<?php
$id=$_GET['id'];
$categorie=$_GET['categorie'];
$nom_message=$_GET['nom_message'];
echo '<span class="titre_categorie"><a href="afficher_message.php?categorie='.$categorie.' ">'.$categorie.'</a> < '.$nom_message.'</span>';
?>
<!-- afficher question ou sujet -->
<?php include("includes/connection_db.php"); ?>
<?php
if ($id=$_GET['id'])
{
$sql="SELECT * FROM $tbl_name1 where id='$id' ";
$result=mysql_query($sql);
$rows=mysql_fetch_array($result);
?>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolor="1" bgcolor="#FFFFFF">
<tr>
<td bgcolor="#F8F7F1"><strong><?php echo $rows['nom_message']; ?></strong></td>
</tr>
<tr>
<td bgcolor="#F8F7F1"><?php echo $rows['message']; ?></td>
</tr>
<tr>
<td bgcolor="#F8F7F1"><strong>Par :</strong> <? echo $rows['nom']; ?>
<strong>Email : </strong><?php echo $rows['email'];?></td>
</tr>
<tr>
<td bgcolor="#F8F7F1"><strong>Date : </strong><?php echo $rows['date']; ?></td>
</tr>
</table>
<br>
<!-- afficher commentaire -->
<?php
$sql2="SELECT * FROM $tbl_name2 WHERE question_id='$id'";
$result2=mysql_query($sql2);
while($rows=mysql_fetch_array($result2))
{
?>
<table width="400px" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" accept-charset="utf-8">
<tr>
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td width="18%" bgcolor="#F8F7F1"><strong>Nom</strong></td>
<td width="5%" bgcolor="#F8F7F1">:</td>
<td width="77%" bgcolor="#F8F7F1"><?php echo $rows['c_nom']; ?></td>
</tr>
<tr>
<td bgcolor="#F8F7F1"><strong>Email</strong></td>
<td bgcolor="#F8F7F1">:</td>
<td bgcolor="#F8F7F1"><?php echo $rows['c_email']; ?></td>
</tr>
<tr>
<td bgcolor="#F8F7F1"><strong>Reponse</strong></td>
<td bgcolor="#F8F7F1">:</td>
<td bgcolor="#F8F7F1"><?php echo $rows['c_reponse']; ?></td>
</tr>
<tr>
<td bgcolor="#F8F7F1"><strong>Date</strong></td>
<td bgcolor="#F8F7F1">:</td>
<td bgcolor="#F8F7F1"><?php echo $rows['c_date']; ?></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<?
}
$sql3="SELECT vu FROM $tbl_name1 WHERE id='$id'";
$result3=mysql_query($sql3);
$rows=mysql_fetch_array($result3);
$view=$rows['vu'];
if(empty($view))
{
$view=1;
$sql4="INSERT INTO $tbl_name1(vu) VALUES('$view') WHERE id='$id'";
$result4=mysql_query($sql4);
}
$addview=$view+1;
$sql5="update $tbl_name1 set vu='$addview' WHERE id='$id'";
$result5=mysql_query($sql5);
mysql_close();
}
?>
<br>
<table width="500px" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<form name="form1" method="post" action="ajouter_commentaire.php">
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td width="18%"><strong>Nom</strong></td>
<td width="3%">:</td>
<td width="79%"><input name="c_nom" type="text" id="c_nom" size="45"></td>
</tr>
<tr>
<td><strong>Email</strong></td>
<td>:</td>
<td><input name="c_email" type="text" id="c_email" size="45"></td>
</tr>
<tr>
<td valign="top"><strong>Reponse</strong></td>
<td valign="top">:</td>
<td><textarea name="c_reponse" cols="45" rows="3" id="c_reponse"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input name="id" id="id" type="hidden" value="<?php echo $id; ?>">
<input name="categorie" id="categorie" type="hidden" value="<?php echo $categorie; ?>"</td>
<td><input type="submit" name="Submit" value="Commentez"> <input type="reset" name="Submit2" value="Reset"></td>
</tr>
</table>
</form>
</table>
</div>
</div>
</div>
<!-- pied de page -->
<?php include("includes/pied_de_page.php"); ?>
</body>
</html>
Parse error: syntax error, unexpected $end in C:\EasyPHP-5.3.9\www\forum_ECHANGE\afficher_commentaire.php on line 148
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<meta charset="utf-8" />
<title>Sujet</title>
</head>
<body>
<!-- Page Global -->
<div id="global">
<!-- menu -->
<?php include("includes/menu.php"); ?>
<!-- en-tete -->
<?php include("includes/en_tete.php"); ?>
<!-- section -->
<div id="section">
<!-- navigation -->
<?php include("includes/navigation.php"); ?>
<!-- article -->
<div class="article">
<?php
$id=$_GET['id'];
$categorie=$_GET['categorie'];
$nom_message=$_GET['nom_message'];
echo '<span class="titre_categorie"><a href="afficher_message.php?categorie='.$categorie.' ">'.$categorie.'</a> < '.$nom_message.'</span>';
?>
<!-- afficher question ou sujet -->
<?php include("includes/connection_db.php"); ?>
<?php
if ($id=$_GET['id'])
{
$sql="SELECT * FROM $tbl_name1 where id='$id' ";
$result=mysql_query($sql);
$rows=mysql_fetch_array($result);
?>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolor="1" bgcolor="#FFFFFF">
<tr>
<td bgcolor="#F8F7F1"><strong><?php echo $rows['nom_message']; ?></strong></td>
</tr>
<tr>
<td bgcolor="#F8F7F1"><?php echo $rows['message']; ?></td>
</tr>
<tr>
<td bgcolor="#F8F7F1"><strong>Par :</strong> <? echo $rows['nom']; ?>
<strong>Email : </strong><?php echo $rows['email'];?></td>
</tr>
<tr>
<td bgcolor="#F8F7F1"><strong>Date : </strong><?php echo $rows['date']; ?></td>
</tr>
</table>
<br>
<!-- afficher commentaire -->
<?php
$sql2="SELECT * FROM $tbl_name2 WHERE question_id='$id'";
$result2=mysql_query($sql2);
while($rows=mysql_fetch_array($result2))
{
?>
<table width="400px" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" accept-charset="utf-8">
<tr>
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td width="18%" bgcolor="#F8F7F1"><strong>Nom</strong></td>
<td width="5%" bgcolor="#F8F7F1">:</td>
<td width="77%" bgcolor="#F8F7F1"><?php echo $rows['c_nom']; ?></td>
</tr>
<tr>
<td bgcolor="#F8F7F1"><strong>Email</strong></td>
<td bgcolor="#F8F7F1">:</td>
<td bgcolor="#F8F7F1"><?php echo $rows['c_email']; ?></td>
</tr>
<tr>
<td bgcolor="#F8F7F1"><strong>Reponse</strong></td>
<td bgcolor="#F8F7F1">:</td>
<td bgcolor="#F8F7F1"><?php echo $rows['c_reponse']; ?></td>
</tr>
<tr>
<td bgcolor="#F8F7F1"><strong>Date</strong></td>
<td bgcolor="#F8F7F1">:</td>
<td bgcolor="#F8F7F1"><?php echo $rows['c_date']; ?></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<?
}
$sql3="SELECT vu FROM $tbl_name1 WHERE id='$id'";
$result3=mysql_query($sql3);
$rows=mysql_fetch_array($result3);
$view=$rows['vu'];
if(empty($view))
{
$view=1;
$sql4="INSERT INTO $tbl_name1(vu) VALUES('$view') WHERE id='$id'";
$result4=mysql_query($sql4);
}
$addview=$view+1;
$sql5="update $tbl_name1 set vu='$addview' WHERE id='$id'";
$result5=mysql_query($sql5);
mysql_close();
}
?>
<br>
<table width="500px" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<form name="form1" method="post" action="ajouter_commentaire.php">
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td width="18%"><strong>Nom</strong></td>
<td width="3%">:</td>
<td width="79%"><input name="c_nom" type="text" id="c_nom" size="45"></td>
</tr>
<tr>
<td><strong>Email</strong></td>
<td>:</td>
<td><input name="c_email" type="text" id="c_email" size="45"></td>
</tr>
<tr>
<td valign="top"><strong>Reponse</strong></td>
<td valign="top">:</td>
<td><textarea name="c_reponse" cols="45" rows="3" id="c_reponse"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input name="id" id="id" type="hidden" value="<?php echo $id; ?>">
<input name="categorie" id="categorie" type="hidden" value="<?php echo $categorie; ?>"</td>
<td><input type="submit" name="Submit" value="Commentez"> <input type="reset" name="Submit2" value="Reset"></td>
</tr>
</table>
</form>
</table>
</div>
</div>
</div>
<!-- pied de page -->
<?php include("includes/pied_de_page.php"); ?>
</body>
</html>