Bonjour
Le fichier texte contient diverses données à propos du concurrents
Je veux afficher les données dans une table
triés par le nombre de points (scores)
le code de formulaire
Code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
<FORM name=Formu2 onsubmit="return verifie();" action="traitement.php"
method=post >
<div align="right">
<p dir="ltr"> </p>
<table border="1" width="600" id="table4" cellspacing="3" cellpadding="3" dir="ltr" bordercolor="#000080">
<tr>
<td ><font face="Times New Roman"><input name="nom" size="30" dir="ltr" style="float: right"></font></td>
<td width="118" align="right" >
<p align="right"><b><font face="Times New Roman" size="4">nom</font></b></td>
</tr>
<tr>
<td align="right" ><font face="Times New Roman"><INPUT size=30
name=prenom dir="ltr"></font></td>
<td width="118" align="right" ><b>
<font face="Times New Roman" size="4">prenom</font></b></td>
</tr>
<tr>
<td align="right" >
<font face="Times New Roman">
<input type="text" name="mail" size="30" dir="ltr"></font></td>
<td width="118" align="right" ><b>
<font face="Times New Roman" size="4">email</font></b></td>
</tr>
<tr>
<td align="right" >
<font face="Times New Roman"> <INPUT size=30 name=age dir="ltr"></font></td>
<td width="118" align="right" ><b>
<font face="Times New Roman" size="4">age</font></b></td>
</tr>
<tr>
<td align="right" ><font face="Times New Roman"><INPUT size=30 name=ville dir="ltr"></font></td>
<td width="118" align="right" ><b>
<font face="Times New Roman" size="4">ville</font></b></td>
</tr>
<tr>
<td align="right" ><font face="Times New Roman"><INPUT size=30 name=pays dir="ltr"></font></td>
<td width="118" align="right" ><b>
<font face="Times New Roman" size="4">pays</font></b></td>
</tr>
<tr>
<td >
<font face="Times New Roman">
<INPUT size=85 name=liste style="float: right"></font>
<p>
<font face="Times New Roman"> </font></td>
<td >
<p align="right"> <b><font face="Times New Roman" size="4">score</font></b></td>
</tr>
<tr>
<td >
<p align="right">
<font face="Times New Roman">
<textarea rows="9" name="comntaire" cols="42" dir="ltr"></textarea></font></td>
<td width="118" align="right" >comntaire</td>
</tr>
<tr>
<td >
</td>
<td width="118" align="right" ><font face="Times New Roman"><INPUT onblur=merci() type=submit value=Envoyer name=submit></font></td>
</tr>
</table>
</div>
<P> </P>
<P> </P>
<font face="Times New Roman">
<INPUT type="hidden" size=3
name=scorec>
<input type="hidden" name="sujet" value="divisaire">
</font>
</FORM> |
Partie du fichier traitement.php
Code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
// fichier txt
$fp = fopen("jeux.txt","a+" );
fputs($fp, "\n" );
fputs($fp, $_POST['nom']);
fputs($fp, " ***** " );
fputs($fp, $_POST['prenom']);
fputs($fp, " ***** " );
fputs($fp, $_POST['scorec']);
fputs($fp, " ***** " );
fputs($fp, $_POST['sujet']);
fputs($fp, "\n
" );
fclose($fp);
echo "Les informations nom et prénoms ont été enregistréés";
// fin fichier txt |
Merci