Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Edycja *.txt
Ardziej
post
Post #1





Grupa: Zarejestrowani
Postów: 64
Pomógł: 1
Dołączył: 5.05.2009

Ostrzeżenie: (0%)
-----


Witam wszystkich.
Wiem, że podobne tematy były już poruszane, mam już super skrypta.

  1. <?php
  2. $fileName="edytowany.txt";
  3. //zapisywanie
  4. $tresc=$_POST["tresc"];
  5. if(isset($tresc))
  6. {  
  7.    $fout=fopen($fileName,"w");  
  8.  
  9.   if($fout!=FALSE)
  10.   {
  11.      fputs($fout,$tresc);
  12.      fclose($fout);
  13.   }  
  14. }
  15.  
  16. //wypisywanie
  17. if(file_exists($fileName))
  18. {
  19.   $fin=fopen($fileName,"rb");
  20.  
  21.   if($fin!=FALSE)
  22.   {      
  23.      while(!(feof($fin)))
  24.      {
  25.         $x=fgets($fin,1024);
  26.      $c.=$x;
  27.      //$cc.=$x."<br>";
  28.      }
  29.    //print(htmlspecialchars($c));  
  30.      fclose($fin);
  31.   }
  32. }  
  33.  
  34.   //formularz  
  35.   $html11=
  36. '
  37.  
  38. <form method="POST" action="edit.php">
  39. <textarea name="tresc" cols="85" rows="20"  maxlength="5">';
  40.  
  41. $html12=
  42. '</textarea>
  43. <input type="submit" value="Wyslij">
  44. </form>
  45. ';
  46.   echo "<hr>n";  
  47.   echo $html11;
  48.   print(htmlspecialchars($c));  
  49.   echo $html12;
  50.   echo "<hr>n";  
  51. echo "<pre>";
  52.   print(htmlspecialchars($c));  
  53. echo "</pre>";
  54. ?>


lecz brakuje mi pliku edit.php

Jakieś sugestie co by miało być w tym pliku?

Z góry dziękuje i Pozdrawiam, Ardziej
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.09.2025 - 18:26