lien javascript et fichier texte
Bonjour.
depuis la page accueil, et à sa fermeture par un bouton,
je demande le vidage d'un fichier texte. A première vue,
ça ne fonctionne pas à chaque fois et garde sa valeur précedente.
pouvez vous me dire svp !
code pg accueil :
Code:
1 2 3
|
<!--lien vers quitter-->
<p align="center" class="Style1" style="line-height:100%; "><span class="Style1" style="line-height:100%; "><span style="font-size:10pt;"><span class="Style1" style="line-height:100%; "><a href="../index.html" target="_self"><img src="../images/quitter_masa.gif" width="10" height="28" border="0" align="middle" onMouseOver="overlib('Retour à l\'index...')" onmouseout="nd()"onClick="javascript:parent.document.location ='chat_adm_fin.php'; "></a></span></span></span> |
code pg chat_adm_fin
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
<?php
//SUPPRIME ET CREER LE FICHIER
$chat_adm = fopen ('/abc/def/plouf_O/chat/chat_adm.txt', "w+");
fclose($chat_adm) ;
$chat_adm = fopen ('/abc/def/plouf_O/chat/chat_adm.txt', "a");
$texte = "absent" ;
// ECRITURE DE LA LIGNE DE LA TABLE
fwrite($chat_adm, $texte);
fwrite($chat_adm,"\n"); //retour à la ligne
fclose($chat_adm) ;
?> |