g3ko Posted March 7, 2005 Report Share Posted March 7, 2005 (edited) vai kads nevar uzrakstit scriptu kas saglaba 2 lauciņus txt failaa tipa ieraksti email un komentu un tas tiek ielikts txt failaa plz plz ļoti vajag studijām Edited March 7, 2005 by g3ko Link to comment Share on other sites More sharing options...
Kavacky Posted March 7, 2005 Report Share Posted March 7, 2005 <?php // Sagatavo ierakstāmo materiālu $dati = array($lauks_1, $lauks_2); // Salipina array elementus stringā $output = implode(";^", $dati); // Ieliek rindas beigas, ja pēc tam grib lasīt pa rindām $output = $output . "\n"; $output = ';*' . $output; // Raksta iekšā $f = fopen("fails.bla", "w"); flock($f, LOCK_EX); fwrite($f, $output) flock($f, LOCK_UN); fclose($f); ?> Link to comment Share on other sites More sharing options...
bubu Posted March 7, 2005 Report Share Posted March 7, 2005 Manuprāt nav jēgas loķēt failu, ja tajā tiek ierakstīt tikai viena rindiņa. Link to comment Share on other sites More sharing options...
LorDRameX Posted March 7, 2005 Report Share Posted March 7, 2005 nez vai ta nevar vienkarshaak\ $lauks1; $lauks2; $ieraksts = $lauks1; $ieraksts .= '||'; $ieraksts .= $lauks2; $ieraksts .= '\n'; $handle = fopen('fails.txt', 'a'); fwrite($handle, $ieraksts); fclose($handle); nu kauka taa PS raxtu uz atminju taka nevaru pateikt ka sintaxe 100% pareiza Link to comment Share on other sites More sharing options...
bubu Posted March 8, 2005 Report Share Posted March 8, 2005 (edited) nez vai ta nevar vienkarshaak\... Var gan: $handle = fopen('fails.txt', 'a'); fwrite($handle, base64_encode($lauks1).'||'.base64_encode($lauks2)."\n"); fclose($handle); Domāju encdoēt ir vērts, lai lietotājs drīkstētu ievadīt || un \n simbolus. Edited March 8, 2005 by bubu Link to comment Share on other sites More sharing options...
g3ko Posted March 8, 2005 Author Report Share Posted March 8, 2005 paldies! Link to comment Share on other sites More sharing options...
parrymason Posted March 26, 2005 Report Share Posted March 26, 2005 Es arī mēģināju, man neiet. Esmu pilnīgs iesācējs :P Link to comment Share on other sites More sharing options...
Kavacky Posted March 26, 2005 Report Share Posted March 26, 2005 Es arī mēģināju, man neiet. Esmu pilnīgs iesācējs :PUn ko tagad darīt? Link to comment Share on other sites More sharing options...
Osiris Posted March 27, 2005 Report Share Posted March 27, 2005 Brīnums ir tur, kur cilvēki grib lai viņien dāvinā gatavus skriptus. Pagūglot arī trūkst smadzenes. Superkoderi no tiem sanāks. :( Varu saprast kad ir problēma, bet kad ir slinkums - nu sorry Link to comment Share on other sites More sharing options...
parrymason Posted April 11, 2005 Report Share Posted April 11, 2005 Un ko tagad darīt? 15600[/snapback] Vairs neko, visu pats atradu. Pagooglēt tiešām der, tas nu ir skaidrs. Link to comment Share on other sites More sharing options...
Recommended Posts