*jancis38* Posted August 26, 2007 Report Share Posted August 26, 2007 Ar šito skriptu itkā vis ir kārtība, tikai kpc viņš neparāda man iekšā textarea tā faila saturu? Viņš rāda tukšu, bet tajā *.txt failā ir saturs. <?php $fails = fopen('test.txt','w'); if($_POST['content']) fwrite($fails,$_POST['content']); ?> <form method="post" action=""><textarea name="content"> <?php $file = file_get_contents ('test.txt'); echo "$file"; ?> </textarea><br><input type="submit" value="Saglabāt izmaiņas"> </form> Link to comment Share on other sites More sharing options...
Val Posted August 26, 2007 Report Share Posted August 26, 2007 (edited) if(isset($_POST['content'])) { $fails = fopen('test.txt','w'); fwrite($fails,$_POST['content']); fclose($fails); }; //labots daudz smadzeņu rievas nevajag, lai izdomātu tādu topika nosaukumu ;) Edited August 26, 2007 by Val Link to comment Share on other sites More sharing options...
bubu Posted August 26, 2007 Report Share Posted August 26, 2007 Pirmkārt: neizlabosi topika nosaukumu šīs dienas laikā, topiks ceļos uz Drazu. Un nākamais topiks - bez brīdinājuma. Otrkārt: paprasi pats sev (vai manuālim, ja nezini) - ko dara otrais parametrs fopen funkcijai, ja tas ir 'w'? Link to comment Share on other sites More sharing options...
andrisp Posted August 26, 2007 Report Share Posted August 26, 2007 bubu, btw, topika nosaukumu nav iespējams rediģēt. Link to comment Share on other sites More sharing options...
bubu Posted August 26, 2007 Report Share Posted August 26, 2007 Neviens jau nav liedzis atsūtīt to uz PM kādam no moderiem/adminiem :) Bet nu ok, uzliktu lai var labot. Link to comment Share on other sites More sharing options...
Labrador Posted August 28, 2007 Report Share Posted August 28, 2007 (edited) pamēģini tur tālākos postus... man palīdzēja un strādā.. ;) http://php.lv/f/index.php?showtopic=7739&a...mp;p=63232& Edited August 28, 2007 by Labrador Link to comment Share on other sites More sharing options...
Recommended Posts