Jump to content
php.lv forumi

counter glucko


ViszinisA

Recommended Posts

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 by ViszinisA
Link to comment
Share on other sites

$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 by MakaTaNaw
Link to comment
Share on other sites

×
×
  • Create New...