Witam,

Mam taki problem ze skryptem a mianowicie.

Gdy edytuje plik języka i zrobię w nim zmianę i chce zapisać dostaje taki komunikat

  1. Forbidden
  2. You don't have permission to access /test.php on this server.
  3. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.


Ze nie mam dostępu do pliku.

A tu skrypt

  1. <?php
  2. $katalog = opendir(LOCALE.LOCALESET."/");
  3. while ($plik = strtolower(readdir($katalog))) {
  4. if ($plik<>"." && $plik<>".." && $plik<>"test.php" ) $lista[]=$plik;
  5. }
  6. closedir($katalog);
  7. if (count($lista)>0) {
  8. echo "Wybierz plik do edycj:";
  9. sort($lista);
  10. }
  11.  
  12. for ($i=0;$i<count($lista);$i++) {
  13. echo "<br />Edytuj plik <b>$lista[$i]</b> <a href=\"test.php?edycja=".LOCALE.LOCALESET."$lista[$i]\">Edytuj plik</a>";
  14. }
  15.  
  16.  
  17. // zmiana zawartosci pliku
  18. $edycja = $_REQUEST["edycja"];
  19. if (isset($_POST["tekst"]) && file_exists($edycja)) {
  20. $f = fopen($edycja, "w");
  21. fputs($f, stripslashes($_POST["tekst"]));
  22. fclose($f);
  23. }
  24.  
  25.  
  26.  
  27. // umieszczenie pliku w formularzu
  28. if ($edycja<>"" && file_exists($edycja)) {
  29. echo "<p> </p>Edycja plik: <b>$edycja</b>";
  30. echo '<form action="../test.php" method="post">
  31. <input type="hidden" name="edycja" value="'.$edycja.'" />
  32. <textarea name="tekst" rows="20" cols="50">';
  33. $f = fopen($edycja,"r");
  34. while(!feof($f)) echo fread($f,1024);
  35. fclose($f);
  36. echo '</textarea>
  37. <input type="submit" value="Zapisz" /></form>';
  38. }
  39. ?>


Jaki jest problem questionmark.gif