Php / include

Fermé
thomas.r Messages postés 79 Date d'inscription jeudi 22 mai 2008 Statut Membre Dernière intervention 29 janvier 2009 - 4 août 2008 à 13:16
thomas.r Messages postés 79 Date d'inscription jeudi 22 mai 2008 Statut Membre Dernière intervention 29 janvier 2009 - 4 août 2008 à 13:33
Bonjour,

J'ai un vrai problème d'include. En fait j'ai deux pages php dont une qui fait appel à l'autre à différents endroits.
Le problème c'est qu'une fonction est donc appelé plusieurs fois et j'obtiens l'erreur : Fatal error: Cannot redeclare mafonction()
Comment est ce que je peux faire pour ne plus avoir cette erreur.

Merci.
A voir également:

1 réponse

Deja poste nous ton code
0
thomas.r Messages postés 79 Date d'inscription jeudi 22 mai 2008 Statut Membre Dernière intervention 29 janvier 2009 2
4 août 2008 à 13:33
voilà:
include 'function.php'
for ($Index_gauche=0;$Index_gauche<ceil($lngIndex/2);$Index_gauche++){
?>
<table width="400">
<tr valign="top">
...
</td>
</tr>
<tr>
<td colspan="3" class="lightBlueBg"></td>
</tr>
</table>
<?
}
?>
</td>

<tr>
<td valign="top">
<?

include 'function.php'
for ($Index_droite>=ceil($lngIndex/2);$Index_droite<$lngIndex;$Index_droite++) {
?>
<table width="400">

</tr>
<tr>
<td colspan="3" class="lightBlueBg"></td>
</tr>
</table>
<?
}
?>
</td>
</tr>
</table>
0