hackerman Posted June 16, 2007 Author Report Share Posted June 16, 2007 Nu labi, ko lai dara ar to class? Link to comment Share on other sites More sharing options...
andrisp Posted June 16, 2007 Report Share Posted June 16, 2007 Parādi to skriptu vēlreiz. 99%, ka tu nepareizā vietā inkludo to klasi. Link to comment Share on other sites More sharing options...
hackerman Posted June 16, 2007 Author Report Share Posted June 16, 2007 http://paste.php.lv/5672 Ja include notiek ārpus for cikla, tad viņš ieraksta visulaiku vienu dziesmu, ja include ir ciklā, met erroru. Link to comment Share on other sites More sharing options...
bubu Posted June 16, 2007 Report Share Posted June 16, 2007 Tu jau ciklā neizmanto $i. Tāpēc arī vienu un to pašu dabū ārā no tā. Link to comment Share on other sites More sharing options...
hackerman Posted June 16, 2007 Author Report Share Posted June 16, 2007 Kā tu to domāji? Itkā jau man parādās 10 ieraksti... ? Link to comment Share on other sites More sharing options...
bubu Posted June 16, 2007 Report Share Posted June 16, 2007 ... un visi ir vienādi. Link to comment Share on other sites More sharing options...
hackerman Posted June 16, 2007 Author Report Share Posted June 16, 2007 Nu pastāsti, kur kļūda. Link to comment Share on other sites More sharing options...
bubu Posted June 16, 2007 Report Share Posted June 16, 2007 Tur, ka tu vienu un to pašu darbību izdari 10 reizes. Tev tak saku - tev cikla iekšiene ir konstanta. Kā gan tu no tās gribi dabūt ārā nekonstantu informāciju? Link to comment Share on other sites More sharing options...
Delfins Posted June 17, 2007 Report Share Posted June 17, 2007 viss sūds sākās ar to, ka raksta kodu pie klases definīcijas (vienā failā): newstats.php <?php class LOL { } $info = new LOL(); ?> Link to comment Share on other sites More sharing options...
hackerman Posted June 17, 2007 Author Report Share Posted June 17, 2007 eeem....Tad man to $info rakstīt citā failā? Link to comment Share on other sites More sharing options...
Delfins Posted June 17, 2007 Report Share Posted June 17, 2007 nu bet protams: <?php require_once('LOL.class.inc.php'); $lol = new LOL(); for (;;) { $lol->retreiveData(); ... sleep(...); } ?> Link to comment Share on other sites More sharing options...
hackerman Posted June 17, 2007 Author Report Share Posted June 17, 2007 Viss strādā. Paldies :* Link to comment Share on other sites More sharing options...
hackerman Posted June 18, 2007 Author Report Share Posted June 18, 2007 (edited) Atkal problēma ;D Man vajag kautko līdzīgu kas tur bija tajā topikā http://php.lv/f/index.php?showtopic=7492 (Pēdējās rindiņas satura noteikšana txt failam) Man vajag uztaisīt pārbaudi. Ņemot andrisp piemēru $content = file('fails.txt'); $content = array_reverse($content, false); echo $content[0]; Vajadzētu kautko tādu: require_once('LOL.class.inc.php'); $lol = new LOL(); for (;;) { $content = file('fails.txt'); $content = array_reverse($content, false); if($content[0] == $lol){ echo ""; }else{ $lol->retreiveData(); ... $fails = "test2.dat"; $atver = fopen($fails, "a"); $raksta = fwrite($atver, $lol. "\r\n"); echo "<br>".$i. ".<b>".date('h:i:s') ."</b> song:".$lol; sleep(...); } } Errorus nemet, bet kods neizpildās. Edited June 18, 2007 by hackerman Link to comment Share on other sites More sharing options...
bubu Posted June 18, 2007 Report Share Posted June 18, 2007 Kādā rakā tu vispār salīdzini stringu $content[0] ar klases LOL instanci $lol ? Link to comment Share on other sites More sharing options...
hackerman Posted June 18, 2007 Author Report Share Posted June 18, 2007 Bet kā tad lai dara? ;D Pasaki kā vajag darīt pareizi. Link to comment Share on other sites More sharing options...
Recommended Posts