Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Prosty Shoutbox
Arsanael
post
Post #1





Grupa: Zarejestrowani
Postów: 65
Pomógł: 0
Dołączył: 4.06.2009

Ostrzeżenie: (0%)
-----


Mam mały problem z shoutboxem. Udało mi sie go zrobić ale problemem jest to ze nowe wiadomosi dodają sie na koncu gdyż w funkcji fopen uzylem atrubutu "a" gdyz nie kasuje reszty pliku. Teraz pytanie jak zrobić tak zeby bylo dobrze i nowe shouty dodawały sie na poczatku ?

kod:

  1. function add_shout($message,$from_user,$data,$time,$handle)
  2. {
  3. $file = fopen($handle,"a");
  4. fputs($file,$data);
  5. fputs($file,' - ');
  6. fputs($file,$time);
  7. fputs($file,' ( ');
  8. fputs($file,$from_user);
  9. fputs($file,' ) : ');
  10. fputs($file,$message);
  11. fputs($file, ' | ');
  12. fclose($file);
  13. header("Location: index.php");
  14. }


Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 01:10