Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
C-/C++-Quelltext |
|
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 |
<html> <head> </head> <body> <? $count; $text; echo "<b> Gästebuch </b> <br>"; //Anzahl der Einträge Prüfen $count_datei = fopen ("count","w+"); $count = fgets ($count_datei,10); fclose ($count_datei); if($count == "") { $count =0; } //Anzahl der Einträge wurde Ermittelt //Einträge auslesen und ausgeben for ($a=0; a < $count;$a++) { //Öffnen und lesen $text_datei = fopen ($a,"w+"); $text = fgets ($text_datei,250); fclose ($text_datei); echo"$text <br>"; echo "<br> <br>"; |
C-/C++-Quelltext |
|
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 |
<? $text = $_POST ["textfeld"]; $count; //Anzahl der bisherigen Einträge herausfinden $counter_datei = fopen ("count","w+"); $count = fgets ($counter_datei,10); echo "$count <br>"; $count +=1;//Ums Eins erhöhen echo "$count <br>"; rewind ($counter_datei); fwrite ($counter_datei,$count); fclose ($counter_datei); //Neuen Eintrag speichern $text_datei = fopen($count,"w+"); fwrite ($text_datei,$text); fclose ($text_datei); echo"Eintrag wurde gespeichert"; echo" Ihr Eintrag: $text"; ?> |
Zitat
Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.
Zitat
for ($a=0; a < $count;$a++)
Werbeanzeige