Mam pewien problem. Chyba coś pomieszałem albo po prostu źle zapisałem. Chodzi mi o to, że po przyjęciu innej wartości niż dozwolona w zmiennej $a skrypt wyświetlił dokument informujący o błędzie. Mi to nie wychodzi. Strony o wartościach x itp ładują się bez problemu lecz kiedy $a nadam wartość np. asd wyskakuje błąd.
Cytat
Warning: main(asd.txt) [function.main]: failed to open stream: No such file or directory in c:\usr\apache\httpd\html\index.php on line 18
Warning: main() [function.include]: Failed opening 'o_mnien.txt' for inclusion (include_path='.') in c:\usr\apache\httpd\html\index.php on line 18
Warning: main() [function.include]: Failed opening 'o_mnien.txt' for inclusion (include_path='.') in c:\usr\apache\httpd\html\index.php on line 18
Co mogę zrobić, żeby wyskakiwał komunikat o nieistniejącej stronie, a nie taki błąd?
Oto kod, który skleciłem:
<?php if ($a = $_GET['a']){ if ($a == "x" or "xa" or "xb" or "xc" or "xd"){ include($a.".txt"); } else{ include("error.txt"); } } else { include("index.txt"); } ?>
Z góry dziękuję za odpowiedzi!
Pozdrawiam,
analfabeta11