Klokjis Posted January 20, 2006 Report Share Posted January 20, 2006 (edited) 2nd edit: lieta taada, ka skriptaa vajag atveert *.txt failu, pieraxtiit klaat rindinju un aizveert *.txt failu. tachu paarsvaraa bezmaxas hostingu serveriem nevar noraadiit kuriem failiem var atljaut tikt redigjeetiem bez ielogoshanaas. a PHP skriptaa nav iespeejams noraadiit - lai pieconnecteejas FTP serverim, taadeejaadi ieguustot atljauju redigjeet to failu? edit: sorry par postu... probleemu pac atrisinaaju ;) 2nd edit: nu ok, sorry! :D Edited January 20, 2006 by Klokjis Link to comment Share on other sites More sharing options...
Kavacky Posted January 20, 2006 Report Share Posted January 20, 2006 (edited) lieta taada, ka skriptaa vajag atveert *.txt failu, pieraxtiit klaat rindinju un aizveert *.txt failu. tachu paarsvaraa bezmaxas hostingu serveriem nevar noraadiit kuriem failiem var atljaut tikt redigjeetiem bez ielogoshanaas. a PHP skriptaa nav iespeejams noraadiit - lai pieconnecteejas FTP serverim, taadeejaadi ieguustot atljauju redigjeet to failu? Chmods caur PHP? LOL, nocitēju tāpēc, ka viņš norediģēja. Un nav smuki likvidēt savas darbības pēdas, kādam varbūt nākotnē noderēs. Un varbūt tas kāds pat izmantos searchu. Edited January 20, 2006 by Kavacky Link to comment Share on other sites More sharing options...
Klokjis Posted January 20, 2006 Author Report Share Posted January 20, 2006 reku negribas taisiit veel topicus, tapeec pajautaashu zem shii. par 1) fgetss() nolasa visu rindinju vai ir kaut kaads tags ar ko var noraadiit ka rindinja beidzas? 2) taadaa gadiijumaa, kaa ar fwrite() var noraadiit lai ieraxta 5as rindinjas, nevis visu vienaa garaa. Link to comment Share on other sites More sharing options...
Vebers Posted January 20, 2006 Report Share Posted January 20, 2006 1) nolasa visu rindinju ir katras rindinjas galaa ir "\n" - newline 2) raksti tā : "pirmā rinda \r\n otrā rinda \r\n trešā rinda" Link to comment Share on other sites More sharing options...
Klokjis Posted January 20, 2006 Author Report Share Posted January 20, 2006 Nu *.txt failaa ieraxtaas shaada rinda. pirmais \r\n otrais \r\n 3.ais \r\n 4.tais \r\n --------------------------------------------------\r\n tachu vinja tiek atteelota nevis pa vairaakaam rindaam bet viss vienaa garaa rindaa un atteelojas arii \r\n skripc sekojoshs <? $fp = fopen($filename, "r") or die("Nevar atvērt $filename"); while(!feof($fp)) { $line = fgetss($fp, 1024); print "$line<br>"; } fclose($fp); ?> Link to comment Share on other sites More sharing options...
Vebers Posted January 20, 2006 Report Share Posted January 20, 2006 (edited) Pie ierakstīšanas strings jaliek iekš double quotes, tad darbosies. Piem. $f=fopen('fails.txt', 'a+'); fwrite($f, "1 \r\n 2 \r\n utt \r\n"); fclose($f); var arī attēlot visu failu uz file_get_contents(); (nolasīs visu failu) un pie attēlošanas pielietot nl2br(); Edited January 20, 2006 by MakaTaNaw Link to comment Share on other sites More sharing options...
Klokjis Posted January 20, 2006 Author Report Share Posted January 20, 2006 kaa ieksh d-quotes? nu man ir $fp = fopen($filename, "a") or die("Nevar atvērt $filename"); fwrite($fp, '1ais: '.$viens.' \r\n 2ais: '.$divi.' \r\n 3ais: '.$triis.' \r\n 4ais: '.$cetri.' \r\n'); fclose($fp); Link to comment Share on other sites More sharing options...
Klokjis Posted January 20, 2006 Author Report Share Posted January 20, 2006 can anybody help me?! :( Link to comment Share on other sites More sharing options...
litt Posted January 20, 2006 Report Share Posted January 20, 2006 $string = 'bla bla bla' . "\r\n"; Link to comment Share on other sites More sharing options...
Kavacky Posted January 20, 2006 Report Share Posted January 20, 2006 Vot vienīgi šitais man nepatīk ar '' - nedarbojas '\r\n'. A to nevar kaut kā apiet, lai nav jāraksta "\r\n"? Link to comment Share on other sites More sharing options...
v3rb0 Posted January 20, 2006 Report Share Posted January 20, 2006 chr(10).chr(13) bet kā īsti pareizi,prasi gūglei Link to comment Share on other sites More sharing options...
Kavacky Posted January 20, 2006 Report Share Posted January 20, 2006 Tā arī ir pareizi. Ak ar chr te mīļais #10#13 nostrādā. Link to comment Share on other sites More sharing options...
Recommended Posts