tiy Posted February 12, 2006 Report Share Posted February 12, 2006 lietotajs ieraksta viesu gramata kadu zinu caur <textarea>, kuru es ierakstu txt faila $path="guest.txt"; $name = $_POST['name']; $msg = $_POST['msg']; $record=$name."+++".$msg."+++"."\n"; $fp=fopen($path,"a+"); $fw=fwrite($fp,$record); fclose($fp); , ka man ierakstit $msg ,lai paliktu usera enters, tani vieta ,kur vish to ierakstija teksta, jo failu nolasu ar f-ju file ($path), ierakstu sho masiva un tad ar explode, bet tik lidz ir usera enteri sakas gluki, txt faila vini ir ,bet nav ar sho zimi \n, tad ka man izvadit visu msg ar enteriem un bez erorriem. Link to comment Share on other sites More sharing options...
bubu Posted February 12, 2006 Report Share Posted February 12, 2006 $msg = nl2br($_POST['msg']); Link to comment Share on other sites More sharing options...
tiy Posted February 12, 2006 Author Report Share Posted February 12, 2006 (edited) $msg = nl2br($_POST['msg']); es jau ta meginaju fila vinsh ieraksta ta piem: vards||message||\n vards||message dasfsdf asdff ||\n un ja ar f-ju $mas=file("fails.txt") ; echo count($mas) mas bus 5, bet vajadzetu but 2, ps vinsh saliek tos <br /> Edited February 12, 2006 by tiy Link to comment Share on other sites More sharing options...
bubu Posted February 12, 2006 Report Share Posted February 12, 2006 Tāpēc jau vajag nl2br(). To ko tu rādi, tur nav nl2br pielietots. Link to comment Share on other sites More sharing options...
tiy Posted February 12, 2006 Author Report Share Posted February 12, 2006 (edited) es ari to nl2br izmantoju tapatas bija errori, jo vinsh pieksta masiv klat ari <br /> Edited February 12, 2006 by tiy Link to comment Share on other sites More sharing options...
Kristabs Posted February 12, 2006 Report Share Posted February 12, 2006 to nl2br liec klaat, kad izvadi to $msg, nevis, kad glabaa Link to comment Share on other sites More sharing options...
tiy Posted February 12, 2006 Author Report Share Posted February 12, 2006 viss tema slegta pariza rindina bija shada un viss strda 100% $msg = ereg_replace("\n", "<br/>", $_POST['msg']); Link to comment Share on other sites More sharing options...
bubu Posted February 12, 2006 Report Share Posted February 12, 2006 Kristabs: muļķības - rindiņas taču atdala ierakstus, tur nedrīkst lieku būt. tiy: tas ir tas pats ko es tev teicu, tikai variantā čerez ž. Link to comment Share on other sites More sharing options...
Stopp Posted February 13, 2006 Report Share Posted February 13, 2006 (edited) Kristabs: muļķības - rindiņas taču atdala ierakstus, tur nedrīkst lieku būt. viņš taču teica pie izvadīšanas, kas neietekmē count.. ups :) Edited February 13, 2006 by Stopp Link to comment Share on other sites More sharing options...
Recommended Posts