Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]pomocy pytanie o klasse.
aristokratis
post 7.04.2012, 22:45:53
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 7.04.2012

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


oto kod mojego bledu:
Undefined variable: PHP_SELF.

to klasa odpowiadajaca za wyswietlanie zawartosci na stronie:
  1. /* class.php */
  2. class Page
  3. {
  4. public function getPage($main_content)
  5. {
  6. return print $main_content;
  7. }
  8. }

  1. <?php
  2. /* index.php */
  3. $site = new Page;
  4. // ...
  5. if(!$logged)
  6. {
  7. $main_content .= '
  8. <form method="post" action="'.$PHP_SELF.'">
  9. <div align="center"><b>Login:</b><br /><input type="text" name="user" /></div>
  10. <div align="center"><b>Password:</b><br /><input type="password" name="password" /></div>
  11. <div align="center"><input type="submit" value=" login " /></div>
  12. </form>
  13. ';
  14. }
  15. // ...
  16. $site->getPage($main_content);
  17. ?>


//Edit
potrzebuje php self dlatego ze pelne zapytanie mialo by mniej wiecej forme:
http://localhost/?subtopic=account_manager
lub u admina przy edycji uzytkownikow
http://localhost/?subtopic=account_manager...action=add_news

Ten post edytował aristokratis 7.04.2012, 22:49:47
Go to the top of the page
+Quote Post
-Gość-
post 7.04.2012, 22:48:38
Post #2





Goście







$_SERVER['PHP_SELF'] a nie $PHP_SELF
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.07.2025 - 16:46