Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Łatwy IF
Kredka29
post
Post #1





Grupa: Zarejestrowani
Postów: 78
Pomógł: 1
Dołączył: 6.12.2008
Skąd: Polska

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


config.php
  1. <?php
  2. //Konfiguracja
  3. $stan="off";
  4. [...]
  5. ?>

index.php
  1. <?php
  2. include "config.php";
  3.  
  4. if ($stan="on")
  5. {
  6. include "online.html";
  7. }
  8. else
  9. {
  10.  if ($stan="off")
  11.  {
  12.  include "offline.html";
  13.  }
  14. }
  15. ?>

Co tu jest źle? Bo niezależnie co ustawię w config'u, to i tak includuje się online.html... (IMG:http://forum.php.pl/style_emoticons/default/wstydnis.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
Spawnm
post
Post #2





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




nie $stan="on" tylko $stan=="on"
Go to the top of the page
+Quote Post
Kredka29
post
Post #3





Grupa: Zarejestrowani
Postów: 78
Pomógł: 1
Dołączył: 6.12.2008
Skąd: Polska

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


Dzięki (IMG:http://forum.php.pl/style_emoticons/default/wstydnis.gif)
Go to the top of the page
+Quote Post

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: 24.08.2025 - 16:31