sinon tu fais :
kom ca tu testes bien si c vide. par contre fo ke la variable existe. si tu veux tester si elle existe :
Houzéf@ - www.123toto.com-------------------------------
Réponse au message :
-------------------------------
>
> Salut
>
> essaye
>
> if ($affich[2] != "")
>
> a la place de
>
> if ($affich[2] != " ")
>
> Car la tu test pas si $affich[2] est vide, tu test si il est egal a un espace
>
> ++
>
> ------
>
Je cherche un poste de developpeur PHP mysql, si vous avez une proposition ou si vous voulez mon CV ==> mailto:tortue.geniale@laposte.net
> >
> => http://www.kame-house.org La plus grosse base de données de DA du net
>
>
> -------------------------------
> Réponse au message :
> -------------------------------
>
> > <?
> > $fp=fopen("acceuil.txt","r");
> > while(!feof($fp)){
> > $affich=explode("|",fgets($fp,4096));
> > print "<TR>";
> > print "<TD ALIGN='CENTER' background='img/border_left_1.gif' width='13' height='33'> </td>";
> >
> > if ($affich[2] != " ")
> > {
> > print "<TD ALIGN='CENTER' height='33' width='167' bgcolor='#DDE6E4' colspan='5' ><p align='left'><font color=#006600 size='2'><a href='$affich[0]'>$affich[1]</a></font><IMG SRC='$affich[2] WIDTH=100% HEIGH=100%></td>";
> > }
> > else
> > {
> > print "<TD ALIGN='CENTER' height='33' width='167' bgcolor='#DDE6E4' colspan='5' ><p align='left'><font color=#006600 size='2'><a href='$affich[0]'>$affich[1]</a></font></td>";
> > }
> > print "<TD ALIGN='CENTER' background='img/border_right_1.gif' width='18' height='33'> </td>";
> > print "</TR>";
> > }
> > fclose($fp);
> > ?>
> >
> > Voilà ce que ce script est censé faire :
> >
> > Ouverture du fichier Acceuil.txt
> > Lecture du fichier tant que l'on n'est pas à la fin du fichier
> > Mettre dans une sorte de tableau, les parties séparées par le caractères | dans la ligne du fichier txt.
> > exemple du fichier acceuil.txt
> > "
> > decription.php|Description|image.jpg
> > affiche.php|Affiche|
> > ...
> > "
> >
> > tester si $affiche[2] est vide (donc si c vide, on affiche pas d'image, on affiche juste le lien)
> > Sinon, on affiche le lien plus l'image.
> >
> > A mon avis, le problème viens du If avec $affiche[2] mais sinon, je comprends po pourquoi ça marche po :(
> >
>