Page 1 sur 1

PArse Error

Posté : 21 mars 2013, 15:43
par sicca
Bonjour à tous,

J'ai une erreur parse error sur cette partie de fichier depuis que je suis passé sur un nouveau serveur avec la dernière version de PHP merci pour votre aide :

<table width="140" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="Bg_Left_Menu">
<?PHP if($_GET["page"]=='presentation') { echo ?>
<a href="./?page=presentation" class="Link_Left_Menu_On">Pr&eacute;sentation</a>
<?PHP ; } else { echo ?>
<a href="./?page=presentation" class="Link_Left_Menu">Pr&eacute;sentation</a>
<?PHP ; } ?>

<?PHP if($_GET['page']=='entreprises') { echo ?>
<a href="./?page=entreprises" class="Link_Left_Menu_On">Entreprises</a>
<?PHP ; } else { echo ?>
<a href="./?page=entreprises" class="Link_Left_Menu">Entreprises</a>
<?PHP ; } ?>

<?PHP if($_GET['page']=='particuliers') { echo ?>
<a href="./?page=particuliers" class="Link_Left_Menu_On">Particuliers</a>
<?PHP ; } else { echo ?>
<a href="./?page=particuliers" class="Link_Left_Menu">Particuliers</a>
<?PHP ; } ?>

<?PHP if($_GET['page']=='auteurs') { echo ?>
<a href="./?page=auteurs" class="Link_Left_Menu_On">Auteurs</a>
<?PHP ; } else { echo ?>
<a href="./?page=auteurs" class="Link_Left_Menu">Auteurs</a>
<?PHP ; } ?>

Re: PArse Error

Posté : 21 mars 2013, 16:33
par [Compte supprime]
Bonjour,

Je ne trouve pas de balise de fin pour le <table>

Re: PArse Error

Posté : 21 mars 2013, 17:09
par sicca
Ha oui j'ai omis de préciser que ce n'était qu'une partie de code, vois la page entière :

<link href="../css/presenta.css" rel="stylesheet" type="text/css">
<link href="../css/Typo.css" rel="stylesheet" type="text/css">
<div class="Content_Left_Menu">
<div style="margin-left:52px; float:left;">
<table width="140" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="Bg_Left_Menu">
<?PHP if($_GET["page"]=='presentation') { echo ?>
<a href="./?page=presentation" class="Link_Left_Menu_On">Pr&eacute;sentation</a>
<?PHP ; } else { echo ?>
<a href="./?page=presentation" class="Link_Left_Menu">Pr&eacute;sentation</a>
<?PHP ; } ?>

<?PHP if($_GET['page']=='entreprises') { echo ?>
<a href="./?page=entreprises" class="Link_Left_Menu_On">Entreprises</a>
<?PHP ; } else { echo ?>
<a href="./?page=entreprises" class="Link_Left_Menu">Entreprises</a>
<?PHP ; } ?>

<?PHP if($_GET['page']=='particuliers') { echo ?>
<a href="./?page=particuliers" class="Link_Left_Menu_On">Particuliers</a>
<?PHP ; } else { echo ?>
<a href="./?page=particuliers" class="Link_Left_Menu">Particuliers</a>
<?PHP ; } ?>

<?PHP if($_GET['page']=='auteurs') { echo ?>
<a href="./?page=auteurs" class="Link_Left_Menu_On">Auteurs</a>
<?PHP ; } else { echo ?>
<a href="./?page=auteurs" class="Link_Left_Menu">Auteurs</a>
<?PHP ; } ?>

</td>
</tr>
<tr>
<td class="Sub_Left_Menu">&nbsp;</td>
</tr>
</table>
</div>
<?PHP if($_GET['page']=='entreprises') { echo ?>
<div style="margin-left:52px; float:left;">
<table width="140" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="Top_Left_Content_Sub">&nbsp;</td>
</tr>
<tr>
<td align="center" valign="top" class="Left_Content_Sub">
<div style="margin-bottom:4px; padding-bottom:4px; margin-right:4px; border-bottom:dotted; border-bottom-width:1px; border-bottom-color:#cccccc">
<strong>Des services pour tous.<br />
Une solution pour chacun.</strong>
</div>
<div align="left">
<span class="Li_Left_Menu_01">Artisans</span>
<span class="Li_Left_Menu_01">Commer&ccedil;ants</span>
<span class="Li_Left_Menu_01">PME</span>
<span class="Li_Left_Menu_01">Associations</span>
<span class="Li_Left_Menu_01">Professions lib&eacute;rales</span>
<span class="Li_Left_Menu_01">Ind&eacute;pendants </span>
<span class="Li_Left_Menu_01">Etc.</span></div></td>
</tr>
<tr>
<td class="Bottom_Left_Content_Sub">&nbsp;</td>
</tr>
</table>
</div>
<?PHP ; } ?>

<?PHP if($_GET['page']=='particuliers') { echo ?>
<div style="margin-left:52px; float:left;">
<table width="140" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="Top_Left_Content_Sub">&nbsp;</td>
</tr>
<tr>
<td align="center" valign="top" class="Left_Content_Sub">
<div style="margin-bottom:4px; padding-bottom:4px; margin-right:4px; border-bottom:dotted; border-bottom-width:1px; border-bottom-color:#cccccc">
<strong>Des services pour tous.<br />
Une solution pour chacun.</strong>
</div>
<div align="left">
<span class="Li_Left_Menu_01">Etudiants</span>
<span class="Li_Left_Menu_01">Demandeurs d'emploi</span>
<span class="Li_Left_Menu_01">Actifs</span>
<span class="Li_Left_Menu_01">Retraités</span><span class="Li_Left_Menu_01">R&eacute;sidents &eacute;trangers</span><span class="Li_Left_Menu_01">Etc.</span></div></td>
</tr>
<tr>
<td class="Bottom_Left_Content_Sub">&nbsp;</td>
</tr>
</table>
</div>
<?PHP ; } ?>

<?PHP if($_GET['page']=='auteurs') { echo ?>
<div style="margin-left:52px; float:left;">
<table width="140" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="Top_Left_Content_Sub">&nbsp;</td>
</tr>
<tr>
<td align="center" valign="top" class="Left_Content_Sub">
<div style="margin-bottom:4px;">
<div style="margin-bottom:4px; padding-bottom:4px; margin-right:4px; border-bottom:dotted; border-bottom-width:1px; border-bottom-color:#cccccc">
<strong>Des services pour tous.<br />
Une solution pour chacun.</strong>
</div>
<div align="left">
<span class="Li_Left_Menu_01">Auteurs</span>
<span class="Li_Left_Menu_01">Editeurs</span>
<span class="Li_Left_Menu_01">Journalistes</span>
<span class="Li_Left_Menu_01">Etc.</span>
</div></td>
</tr>
<tr>
<td class="Bottom_Left_Content_Sub">&nbsp;</td>
</tr>
</table>
</div>
<?PHP ; } ?>
</div>

Re: PArse Error

Posté : 21 mars 2013, 17:43
par xTG
Tu as un point virgule après chaque balise <?php
Je suis fortement étonné que cela ne tique pas et ce quelle que soit la version de PHP...

Re: PArse Error

Posté : 21 mars 2013, 17:47
par sicca
Un ami viens de m'apporter la solution, voici la bonne syntaxe :

<link href="../css/presenta.css" rel="stylesheet" type="text/css">
<link href="../css/Typo.css" rel="stylesheet" type="text/css">
<div class="Content_Left_Menu">
<div style="margin-left:52px; float:left;">
<table width="140" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="Bg_Left_Menu">
<?PHP if($_GET["page"]=='presentation') { echo ?>
<a href="./?page=presentation" class="Link_Left_Menu_On">Pr&eacute;sentation</a>
<?PHP ; } else { echo ?>
<a href="./?page=presentation" class="Link_Left_Menu">Pr&eacute;sentation</a>
<?PHP ; } ?>

<?PHP if($_GET['page']=='entreprises') { echo ?>
<a href="./?page=entreprises" class="Link_Left_Menu_On">Entreprises</a>
<?PHP ; } else { echo ?>
<a href="./?page=entreprises" class="Link_Left_Menu">Entreprises</a>
<?PHP ; } ?>

<?PHP if($_GET['page']=='particuliers') { echo ?>
<a href="./?page=particuliers" class="Link_Left_Menu_On">Particuliers</a>
<?PHP ; } else { echo ?>
<a href="./?page=particuliers" class="Link_Left_Menu">Particuliers</a>
<?PHP ; } ?>

<?PHP if($_GET['page']=='auteurs') { echo ?>
<a href="./?page=auteurs" class="Link_Left_Menu_On">Auteurs</a>
<?PHP ; } else { echo ?>
<a href="./?page=auteurs" class="Link_Left_Menu">Auteurs</a>
<?PHP ; } ?>

</td>
</tr>
<tr>
<td class="Sub_Left_Menu">&nbsp;</td>
</tr>
</table>
</div>
<?PHP if($_GET['page']=='entreprises') { echo ?>
<div style="margin-left:52px; float:left;">
<table width="140" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="Top_Left_Content_Sub">&nbsp;</td>
</tr>
<tr>
<td align="center" valign="top" class="Left_Content_Sub">
<div style="margin-bottom:4px; padding-bottom:4px; margin-right:4px; border-bottom:dotted; border-bottom-width:1px; border-bottom-color:#cccccc">
<strong>Des services pour tous.<br />
Une solution pour chacun.</strong>
</div>
<div align="left">
<span class="Li_Left_Menu_01">Artisans</span>
<span class="Li_Left_Menu_01">Commer&ccedil;ants</span>
<span class="Li_Left_Menu_01">PME</span>
<span class="Li_Left_Menu_01">Associations</span>
<span class="Li_Left_Menu_01">Professions lib&eacute;rales</span>
<span class="Li_Left_Menu_01">Ind&eacute;pendants </span>
<span class="Li_Left_Menu_01">Etc.</span></div></td>
</tr>
<tr>
<td class="Bottom_Left_Content_Sub">&nbsp;</td>
</tr>
</table>
</div>
<?PHP ; } ?>

<?PHP if($_GET['page']=='particuliers') { echo ?>
<div style="margin-left:52px; float:left;">
<table width="140" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="Top_Left_Content_Sub">&nbsp;</td>
</tr>
<tr>
<td align="center" valign="top" class="Left_Content_Sub">
<div style="margin-bottom:4px; padding-bottom:4px; margin-right:4px; border-bottom:dotted; border-bottom-width:1px; border-bottom-color:#cccccc">
<strong>Des services pour tous.<br />
Une solution pour chacun.</strong>
</div>
<div align="left">
<span class="Li_Left_Menu_01">Etudiants</span>
<span class="Li_Left_Menu_01">Demandeurs d'emploi</span>
<span class="Li_Left_Menu_01">Actifs</span>
<span class="Li_Left_Menu_01">Retraités</span><span class="Li_Left_Menu_01">R&eacute;sidents &eacute;trangers</span><span class="Li_Left_Menu_01">Etc.</span></div></td>
</tr>
<tr>
<td class="Bottom_Left_Content_Sub">&nbsp;</td>
</tr>
</table>
</div>
<?PHP ; } ?>

<?PHP if($_GET['page']=='auteurs') { echo ?>
<div style="margin-left:52px; float:left;">
<table width="140" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="Top_Left_Content_Sub">&nbsp;</td>
</tr>
<tr>
<td align="center" valign="top" class="Left_Content_Sub">
<div style="margin-bottom:4px;">
<div style="margin-bottom:4px; padding-bottom:4px; margin-right:4px; border-bottom:dotted; border-bottom-width:1px; border-bottom-color:#cccccc">
<strong>Des services pour tous.<br />
Une solution pour chacun.</strong>
</div>
<div align="left">
<span class="Li_Left_Menu_01">Auteurs</span>
<span class="Li_Left_Menu_01">Editeurs</span>
<span class="Li_Left_Menu_01">Journalistes</span>
<span class="Li_Left_Menu_01">Etc.</span>
</div></td>
</tr>
<tr>
<td class="Bottom_Left_Content_Sub">&nbsp;</td>
</tr>
</table>
</div>
<?PHP ; } ?>
</div>

Re: PArse Error

Posté : 21 mars 2013, 17:48
par sicca
Mince, je n'arrive pas à modifier le sujet en [Résolu] ^^

Re: PArse Error

Posté : 21 mars 2013, 21:46
par xTG
C'est pareil, c'est horrible ce code...
Pourquoi utiliser des echo et ne rien mettre dedans ?
Pourquoi mettre des points virgule là où il n'y a aucune instruction ?
<?PHP if($_GET["page"]=='presentation') { ?>
<a href="./?page=presentation" class="Link_Left_Menu_On">Pr&eacute;sentation</a>
<?PHP } else { ?>
<a href="./?page=presentation" class="Link_Left_Menu">Pr&eacute;sentation</a>
<?PHP } ?>
ou
<?PHP if($_GET["page"]=='presentation') { 
  echo '<a href="./?page=presentation" class="Link_Left_Menu_On">Pr&eacute;sentation</a>';
} else {
  echo '<a href="./?page=presentation" class="Link_Left_Menu">Pr&eacute;sentation</a>';
} ?>

Re: PArse Error

Posté : 22 mars 2013, 06:28
par Fre3z69
Il serais pas mieux en débutant ce sujet?

Je dis ça je dis rien :roll: