Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Pomieszanie z katalogami
daniel1302
post
Post #1





Grupa: Zarejestrowani
Postów: 602
Pomógł: 30
Dołączył: 1.08.2007
Skąd: Nowy Sącz

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


Moja klasa wygląda tak
  1. <?php 
  2.  
  3. /*Zadanie pliku: wyświetlenie, dodawanie newsow, edytowanie, kasacja 
  4. ogólna klasa jest matką klas do edycji/ dodawania/ kasowania profilu, plotek, newsow*/
  5. Class Editor 
  6. {
  7. var $result;
  8. var $pathin = './../'; 
  9. public function ViewEditor($action, $tresc)
  10. {
  11. $this -> result = require_once($this->pathin.'oddFiles/EditorForm.php');
  12. return $this->result;
  13. }
  14.  
  15. public function ReturnResult()
  16. {
  17. $this -> result = ($_POST['zwroc_wynik'] == '') ? 'Nie wypełniono pola edytora' : $_POST['zwroc_wynik'];
  18. return $this -> result;
  19. }
  20.  
  21. public function __destruct ()
  22. {
  23. unset($result);
  24. }
  25. }
  26.  
  27. ?>


i jeśli zmienna $pathin jest równa ./../
to plik bez ajaxu wywali bug


  1. Warning: Editor::require_once(./../oddFiles/EditorForm.php) [function.Editor-require-once]: failed to open stream: No such file or directory in D:\Program Files\WebServ1\httpd\test\class\class.Editor.php on line 11
  2.  
  3. Fatal error: Editor::require_once() [function.require]: Failed opening required './../oddFiles/EditorForm.php' (include_path='.;C:\php5\pear') in D:\Program Files\WebServ1\httpd\test\class\class.Editor.php on line 11


a jeśli ./ to plik z ajaxem wywali bug

  1. Warning: Missing argument 2 for Editor::ViewEditor(), called in D:\Program Files\WebServ1\httpd\test\oddFiles\account.php on line 48 and defined in D:\Program Files\WebServ1\httpd\test\class\class.Editor.php on line 9



Prosze o pomoc
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
RubiX
post
Post #2





Grupa: Zarejestrowani
Postów: 162
Pomógł: 6
Dołączył: 14.02.2007
Skąd: Poznań

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


A co za problem z podaniem tego ? :

  1. <?php
  2. $serwer = $_SERVER['DOCUMENT_ROOT'];
  3. $folder = "/test/"; // tu wpisujesz nazwę folderu
  4.  
  5. // i łączysz te 2 zmienne
  6. echo "folder: ".$serwer."".$folder."";
  7. ?>


i powinieneś to do Twojej klasy jakoś umieścić
no chyba że coś źle myślę ?

  1. <?php
  2. var $pathin = ''.$_SERVER['DOCUMENT_ROOT'].'/test/';
  3. ?>


Ten post edytował RubiX 8.01.2008, 11:20:51
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: 9.10.2025 - 05:24