[php] probleme d'offset
nicolas0057
Messages postés
1
Date d'inscription
Statut
Membre
Dernière intervention
-
xbb Messages postés 49 Date d'inscription Statut Membre Dernière intervention -
xbb Messages postés 49 Date d'inscription Statut Membre Dernière intervention -
Bonjour, j'ai un problème d'offset.
Voici le code :
$pass = 1;
$i = 0;
?>
<p align="center"><b><font color="#000000">effectif de la Section : <? echo $n; if ($n > 1) echo " personnes"; else echo " personne"; ?></font></b></p>
<? while ($i < $n) {?>
<? if ($noms[$i] != "") {?>
<table border="1" width="33%" height="1" align=center>
<tr>
<? if ($noms[$i] != "") {?><td width="33%" height="162" align="center">
<p align="center" style="line-height: 60%"><img src="<? echo $image[$i] ?>" align=center height=172 width=230> </p>
</td>
<? } if ($noms[$i+1] != "") {?>
<td width="33%" height="162" align="center">
<p align="center" style="line-height: 60%"><img src="<? echo $image[$i+1] ?>" align=center height=172 width=230> </p>
</td>
<? } if ($noms[$i+2] != "") {?>
<td width="33%" height="162" align="center">
<p align="center" style="line-height: 60%"><img src="<? echo $image[$i+2] ?>" align=center height=172 width=230> </p>
</td>
</tr>
<?
}
?>
<tr>
<? if ($noms[$i] != "") {?>
<td width="33%" height="29" align="center" bgcolor="#9999FF">
<p align="center" style="line-height: 60%"><? echo $noms[$i]." ".$pre[$i] ?> </p>
</td>
<? } if ($noms[$i+1] != "") {?>
<td width="33%" height="29" align="center" bgcolor="#9999FF">
<p align="center" style="line-height: 60%"><? echo $noms[$i+1]." ".$pre[$i+1] ?> </p>
</td>
<? } if ($noms[$i+2] != "") {?>
<td width="33%" height="29" align="center" bgcolor="#9999FF">
<p align="center" style="line-height: 60%"><? echo $noms[$i+2]." ".$pre[$i+2] ?> </p>
</td>
</tr>
<?
}
?>
<tr>
<? if ($noms[$i] != "") {?>
<td width="33%" height="74" align="center">
<p align="center" style="line-height: 60%"><b><font color="#FF0000">Service
:<? echo $serv[$i] ?></font></b></p>
<p align="center" style="line-height: 60%"><b><font color="#FF0000"> </font><font color="#000066">Section
: <p align="center" style="line-height: 60%"> <? echo $sect[$i] ?> </font></b>
</td>
<? } if ($noms[$i+1] != "") {?>
<td width="33%" height="74" align="center">
<p align="center" style="line-height: 60%"><b><font color="#FF0000">Service
: <? echo $serv[$i+1] ?> </font></b></p>
<p align="center" style="line-height: 60%"><b><font color="#FF0000"> </font><font color="#000066">Section
: <p align="center" style="line-height: 60%"> <? echo $sect[$i+1] ?> </font></b>
</td>
<? } if ($noms[$i+2] != "") {?>
<td width="33%" height="74" align="center">
<p align="center" style="line-height: 60%"><b><font color="#FF0000">Service
: <? echo $serv[$i+2] ?> </font></b></p>
<p align="center" style="line-height: 60%"><b><font color="#FF0000"> </font><font color="#000066">Section
: <p align="center" style="line-height: 60%"> <? echo $sect[$i+2] ?> </font></b>
</td>
<? }$i = $i+3;}?>
Voici les erreurs :
Notice: Undefined offset: 10 in d:\easyphp1-8\www\fichesservices\services.php on line 127
Notice: Undefined offset: 11 in d:\easyphp1-8\www\fichesservices\services.php on line 131
Notice: Undefined offset: 10 in d:\easyphp1-8\www\fichesservices\services.php on line 146
Notice: Undefined offset: 11 in d:\easyphp1-8\www\fichesservices\services.php on line 150
Notice: Undefined offset: 10 in d:\easyphp1-8\www\fichesservices\services.php on line 170
Notice: Undefined offset: 11 in d:\easyphp1-8\www\fichesservices\services.php on line
Merci d'avance.
Voici le code :
$pass = 1;
$i = 0;
?>
<p align="center"><b><font color="#000000">effectif de la Section : <? echo $n; if ($n > 1) echo " personnes"; else echo " personne"; ?></font></b></p>
<? while ($i < $n) {?>
<? if ($noms[$i] != "") {?>
<table border="1" width="33%" height="1" align=center>
<tr>
<? if ($noms[$i] != "") {?><td width="33%" height="162" align="center">
<p align="center" style="line-height: 60%"><img src="<? echo $image[$i] ?>" align=center height=172 width=230> </p>
</td>
<? } if ($noms[$i+1] != "") {?>
<td width="33%" height="162" align="center">
<p align="center" style="line-height: 60%"><img src="<? echo $image[$i+1] ?>" align=center height=172 width=230> </p>
</td>
<? } if ($noms[$i+2] != "") {?>
<td width="33%" height="162" align="center">
<p align="center" style="line-height: 60%"><img src="<? echo $image[$i+2] ?>" align=center height=172 width=230> </p>
</td>
</tr>
<?
}
?>
<tr>
<? if ($noms[$i] != "") {?>
<td width="33%" height="29" align="center" bgcolor="#9999FF">
<p align="center" style="line-height: 60%"><? echo $noms[$i]." ".$pre[$i] ?> </p>
</td>
<? } if ($noms[$i+1] != "") {?>
<td width="33%" height="29" align="center" bgcolor="#9999FF">
<p align="center" style="line-height: 60%"><? echo $noms[$i+1]." ".$pre[$i+1] ?> </p>
</td>
<? } if ($noms[$i+2] != "") {?>
<td width="33%" height="29" align="center" bgcolor="#9999FF">
<p align="center" style="line-height: 60%"><? echo $noms[$i+2]." ".$pre[$i+2] ?> </p>
</td>
</tr>
<?
}
?>
<tr>
<? if ($noms[$i] != "") {?>
<td width="33%" height="74" align="center">
<p align="center" style="line-height: 60%"><b><font color="#FF0000">Service
:<? echo $serv[$i] ?></font></b></p>
<p align="center" style="line-height: 60%"><b><font color="#FF0000"> </font><font color="#000066">Section
: <p align="center" style="line-height: 60%"> <? echo $sect[$i] ?> </font></b>
</td>
<? } if ($noms[$i+1] != "") {?>
<td width="33%" height="74" align="center">
<p align="center" style="line-height: 60%"><b><font color="#FF0000">Service
: <? echo $serv[$i+1] ?> </font></b></p>
<p align="center" style="line-height: 60%"><b><font color="#FF0000"> </font><font color="#000066">Section
: <p align="center" style="line-height: 60%"> <? echo $sect[$i+1] ?> </font></b>
</td>
<? } if ($noms[$i+2] != "") {?>
<td width="33%" height="74" align="center">
<p align="center" style="line-height: 60%"><b><font color="#FF0000">Service
: <? echo $serv[$i+2] ?> </font></b></p>
<p align="center" style="line-height: 60%"><b><font color="#FF0000"> </font><font color="#000066">Section
: <p align="center" style="line-height: 60%"> <? echo $sect[$i+2] ?> </font></b>
</td>
<? }$i = $i+3;}?>
Voici les erreurs :
Notice: Undefined offset: 10 in d:\easyphp1-8\www\fichesservices\services.php on line 127
Notice: Undefined offset: 11 in d:\easyphp1-8\www\fichesservices\services.php on line 131
Notice: Undefined offset: 10 in d:\easyphp1-8\www\fichesservices\services.php on line 146
Notice: Undefined offset: 11 in d:\easyphp1-8\www\fichesservices\services.php on line 150
Notice: Undefined offset: 10 in d:\easyphp1-8\www\fichesservices\services.php on line 170
Notice: Undefined offset: 11 in d:\easyphp1-8\www\fichesservices\services.php on line
Merci d'avance.
A voir également:
- [php] probleme d'offset
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Retour a la ligne php ✓ - Forum PHP
- Php alert - Forum PHP
- Offset electronique ✓ - Forum Programmation