breksis Posted December 18, 2004 Report Share Posted December 18, 2004 Nu, es pat vienkaarshaako nemaaku izdariit :DD <? $useri = fopen('useri.txt', 'r'); echo "Chanaa seezh $useri"; ?> man vajag lai useri.txt saturu paraada index.html failaa.. Link to comment Share on other sites More sharing options...
rudzis Posted December 18, 2004 Report Share Posted December 18, 2004 <? $useri = file('useri.txt'); $skaits = count($useri); echo "Chanaa seezh $useri"; ?> HTML lapā tev php kods nedarbosies, ja tā nebūs inklūdota php lapā. Link to comment Share on other sites More sharing options...
rudzis Posted December 18, 2004 Report Share Posted December 18, 2004 P.S. Pēdējā rindiņā $useri nomaini uz $skaits. Link to comment Share on other sites More sharing options...
tamster Posted December 18, 2004 Report Share Posted December 18, 2004 man vajag lai useri.txt saturu paraada index.html failaa.. <?php include 'useri.txt'; ?> P.S. Es visu uztveru burtiski :) Link to comment Share on other sites More sharing options...
Kavacky Posted December 19, 2004 Report Share Posted December 19, 2004 (edited) Ja tev tur ir rakstīts, cik useru ir, kāds skaitlis. $f = fopen("useri.txt","r"); flock($f,LOCK_SH); $useri = fread($f,filesize("useri.txt")); flock($f,LOCK_UN); fclose($f); echo "Chanaa seezh".$useri; Ja tur ir katrs users savā rindiņā, tad derēs tas, ko rudzis rakstīja. PS - būtu labi, ja varētu uzzināt, kādā formā tev veidots "useri.txt" fails. Vai tur ir katrs users ierakstīts, vai tur ir skaits, vai vēl sazin kas, no kā tie useri jādabū laukā. Edited December 19, 2004 by Kavacky Link to comment Share on other sites More sharing options...
blackhalt Posted December 19, 2004 Report Share Posted December 19, 2004 flock($f,LOCK_SH); diez vai vajag šajā gadījumā mudrīties ar flock. Link to comment Share on other sites More sharing options...
Recommended Posts