Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Klasa + require_once
Forum PHP.pl > Forum > PHP > Object-oriented programming
lDoran
Nie rozumiem dlaczego skrypt się wysypuje, w folderze functions jest plik SecureString.php.

  1. <?php
  2.  
  3.  
  4. class Company
  5. {
  6. private $Company_;
  7. private $Address;
  8. private $City;
  9. private $PostCode;
  10. private $PhoneNumber;
  11. private $Email;
  12. private $NIP;
  13. private $Name;
  14. private $SurName;
  15. private $Position;
  16.  
  17. public function SetCompany($Company__, $Address_, $City_, $PostCode_, $PhoneNumber_, $Email_, $NIP_, $Name_, $SurName_, $Position_)
  18. {
  19. require_once('../functions/SecureString.php');
  20.  
  21. $this -> Company_ = FilterString($Company__);
  22. $this -> Address = FilterString($Address_);
  23. $this -> City = FilterString($City_);
  24. $this -> PostCode = FilterString($PostCode_);
  25. $this -> PhoneNumber = FilterString($PhoneNumber_);
  26. $this -> Email = FilterString($Email_);
  27. $this -> NIP = FilterString($NIP_);
  28. $this -> Name = FilterString($Name_);
  29. $this -> Surname = FilterString($SurName_);
  30. $this -> Positon = FilterString($Position_);
  31.  
  32. $this -> AddToDataBase();
  33. }
  34.  
  35. private function AddToDataBase()
  36. {
  37. require_once('../functions/db_connect.php');
  38.  
  39. $connect = db_connect();
  40.  
  41. $sql = "INSERT INTO Company ($Company_, $Address, $City, $PostCode, $NIP, $Name_, $SurName, $Position_)
  42. VALUES($this -> Company_, $this -> Address, $this -> City, $this -> PostCode, $this -> PhoneNumber,
  43. $this -> Email, $this -> NIP, $this -> Name, $this -> SurName, $this -> Position)";
  44.  
  45. $result = $connect -> query($sql);
  46.  
  47. if(!$result)
  48. echo 'Błąd! Dane nie zostały zapisane.';
  49. }
  50.  
  51. }
  52.  
  53. ?>

Kod
Warning: Company::require_once(../functions/SecureString.php) [function.Company-require-once]: failed to open stream: No such file or directory in C:\WebServ\httpd\sklep\libaries\class.Company.php on line 19

Fatal error: Company::require_once() [function.require]: Failed opening required '../functions/SecureString.php' (include_path='.;C:\php5\pear') in C:\WebServ\httpd\sklep\libaries\class.Company.php on line 19
marcio
Cytat
require_once('../functions/SecureString.php');


Pozmieniaj sciezki.

Btw: masz chyba na windzie srv wiec......smile.gif

To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.