ViszinisA Posted May 22, 2006 Report Share Posted May 22, 2006 (edited) ir counter cods <? $fails_nos = "skaits.txt"; $fails = fopen($fails_nos, "r"); $skaits = fread($fails, 5); fclose($fails); $skaits++; $fails = fopen($fails_nos, "w"); fwrite($fails, $skaits); fclose($fails); ?> (atradu forumaa, bija tur taads) tad kad aiziet liidz 500+ apmekleetaajiem tad skaits aizlec uz 0 man jau 3 reizes noleca uz 0 tas nav jauki Q1: kapeec? Q2: kaa izlabot? Edited May 22, 2006 by ViszinisA Link to comment Share on other sites More sharing options...
Vebers Posted May 22, 2006 Report Share Posted May 22, 2006 (edited) $saturs=file('counter.txt'); $skaits=trim($saturs[0]); $skaits++; $f=fopen('counter.txt', 'w'); fwrite($f, $skaits); fclose($f); EDIT: $skaits = fread($fails, filesize($faila_nos)); Edited May 22, 2006 by MakaTaNaw Link to comment Share on other sites More sharing options...
john.brown Posted May 22, 2006 Report Share Posted May 22, 2006 $skaits = file_get_contents($faila_nos); Link to comment Share on other sites More sharing options...
Recommended Posts