Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Błąd Using $this when not in object context
amii
post 17.10.2010, 16:52:18
Post #1





Grupa: Zarejestrowani
Postów: 728
Pomógł: 76
Dołączył: 12.06.2009

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


Mam skrypt w którym korzystam z gotowej klasy HTTP_Request kawałek kodu z pliku index.php
Wyskakuje mi taki błąd:
Fatal error: Using $this when not in object context in /home/mylogin/domains/strona.pl/public_html/login/index.php on line 13
Klasa korzysta jeszcze z 3 innych plików:
  1. /**
  2.  * PEAR and PEAR_Error classes (for error handling)
  3.  */
  4. require_once 'PEAR.php';
  5. /**
  6.  * Socket class
  7.  */
  8. require_once 'Net/Socket.php';
  9. /**
  10.  * URL handling class
  11.  */
  12. require_once 'Net/URL2.php';


  1. $this->sock =& new HTTP_Request(); //line 13
  2. $this->sock->_allowRedirects = true;
  3. $this->sock->clearCookies();
  4. $this->sock->setURL($url);
  5. $this->sock->setMethod('GET');
  6. $this->sock->sendRequest();


--------------------
gry flash online
Dobry hosting i tanie odnowienia domen firma: masternet.
Zarabianie bez wysiłku na domenach bez ruchu: prolink.
Go to the top of the page
+Quote Post
skowron-line
post 17.10.2010, 16:56:04
Post #2





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

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


Nie możesz po za klasą używać słówka $this.


--------------------
I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy.

QueryBuilder, Mootools.net, bbcradio1::MistaJam
http://www.phpbench.com/
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 13.06.2025 - 04:46