Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]struktura if else
marian84
post
Post #1





Grupa: Zarejestrowani
Postów: 185
Pomógł: 10
Dołączył: 29.01.2008

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


Mam prostą strukturę pliku index.php

Kod
(...)

if($_GET['str']=='foto')
{
    include('foto.php);
}
elseif($_GET['str']=='pliki')
{
    include('costam.php');
}
itd.

(...)


kod niestety wyswietla błąd:

Notice: Undefined index: str in (...) index.php on line 5

Czemu?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
porady-it.pl
post
Post #2





Grupa: Zarejestrowani
Postów: 89
Pomógł: 20
Dołączył: 13.05.2007
Skąd: Warszawa

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


popraw najpierw literówke:
Kod
include('foto.php);

poprawnie:
Kod
include('foto.php');
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: 10.10.2025 - 13:29