cickens Posted December 22, 2009 Report Share Posted December 22, 2009 (edited) Dabūju Čata Skriptu, bet kad to palaižu rādās 2 kļūdas vienu novērsu, bet otru nesaprotu, kas tur pa vainu. <?php //nosakam vai eksistee komentaaru fails if (file_exists("cats.txt")) { //ja fails eksistee dabuujam datus no faila $lines = file("cats.txt"); foreach ($lines as $line_num => $line) { //sagrupeejam ieguutos datus list($niks, $teksts, $datums, $ip) = explode("|" $line); //ja tekstu rakstiijis pats lietotaajs, raadam niku citaa kraasaa if ($niks == $lietotajs) { echo "<span style=\"color: #777\"><b>$niks:</b> $teksts<br /></span>\n"; } else { //ja tekstu rakstiijis kaads cits, drukaajam laukaa taa pat echo "<b>$niks:</b> $teksts<br />\n"; } } } ?> Kļūda itka ir šajā vietā: //sagrupeejam ieguutos datus list($niks, $teksts, $datums, $ip) = explode("|" $line); Edited December 22, 2009 by cickens Link to comment Share on other sites More sharing options...
briedis Posted December 22, 2009 Report Share Posted December 22, 2009 (edited) Mēs te neesam nekādi zīlnieki, lai pateiktu, kas Tev tur ir par kļūdas ziņojumu! :) Edited December 22, 2009 by briedis Link to comment Share on other sites More sharing options...
2easy Posted December 22, 2009 Report Share Posted December 22, 2009 (edited) pārbaudi, vai visās rindās ir 3x "|". vnk ir par maz elementu masīvā tāpēc list() izraisa kļūdu/notice lol, no! vajag komatu!!!!!!!!!!!! funkcijas argumentus atdala ar komatu.... "|", $line p.s. briedi, šis ir labs treniņš, kā uzminēt potenciālos kļūdu paziņojumus no attiecīgā koda ;) just attitude... Edited December 22, 2009 by 2easy Link to comment Share on other sites More sharing options...
Aleksejs Posted December 22, 2009 Report Share Posted December 22, 2009 Un kļūdas paziņojums ir: "Disk Boot Failure. Insert System Disk And Press Enter" ? Link to comment Share on other sites More sharing options...
briedis Posted December 22, 2009 Report Share Posted December 22, 2009 (edited) Nez, pie saglabāšanas koda tiek izemsti visi lietotāja sarakstītie "|" no nika, teksta? :) EDIT: hahahah, 2easy ir acīgs :D Edited December 22, 2009 by briedis Link to comment Share on other sites More sharing options...
2easy Posted December 22, 2009 Report Share Posted December 22, 2009 (edited) hehe, es jau ar to pamanīju, tikai iekopējot to rindu savā editplus, lai nomainītu vērtību :P Edited December 22, 2009 by 2easy Link to comment Share on other sites More sharing options...
cickens Posted December 22, 2009 Author Report Share Posted December 22, 2009 Paldies, 2easy par palīdzību. Viss sanāca. Link to comment Share on other sites More sharing options...
Recommended Posts