Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Błąd failed to open stream...
znyk
post 31.01.2010, 18:52:11
Post #1





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 25.12.2006

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


Kod jest taki:

Kod
<?php
session_start();
include ("fns/conf.php");
include ("fns/db_fns.php");
$controller = 'serwis';
$view = empty($_GET['view']) ? 'index' : $_GET['view'];


switch ($view){
        case 'index' :
                
        break;        
        case 'zabezpieczona':
                    user_login();
        break;
        
        case 'logincheck':
            
            if(check_user_login($_POST['username'],$_POST['password'])){
                header("Location: index.php?view=zabezpieczona");
            
            } else {
                header("Location: index.php?view=logowanie");
            }
        
        break;
        
        case 'wyloguj':
              delete_user_session();
              header("Location: index.php");
        break;
        
}


if($_SERVER['DOCUMENT_ROOT'] == "C:/wamp/www/")
        {
            include ($_SERVER['DOCUMENT_ROOT'].'/LogowanieTutorial/views/layouts/'.$controller.'.php');  // na localhost
        }
        else
        {
            include ($_SERVER['DOCUMENT_ROOT'].'/views/layouts/'.$controller.'.php');  // na server
        }
?>


Błąd taki:
Warning: include(C:/xampp/htdocs/views/layouts/serwis.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\LogowanieTutorial\LogowanieTutorial\index.php on line 42

Warning: include() [function.include]: Failed opening 'C:/xampp/htdocs/views/layouts/serwis.php' for inclusion (include_path='.;\xampp\php\PEAR') in C:\xampp\htdocs\LogowanieTutorial\LogowanieTutorial\index.php on line 42

co jest źle ?
Go to the top of the page
+Quote Post
mhw
post 31.01.2010, 20:19:05
Post #2





Grupa: Zarejestrowani
Postów: 43
Pomógł: 10
Dołączył: 3.08.2009

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


Błąd wskazuje na to, że podajesz złą ścieżkę do include'owanych plików. Podawaj raczej ścieżki lokalne (zaczynające się od katalogu głównego, np. "./views/layouts/something.php"), bez zaczynania od "C:\ ...".


--------------------
"the quieter you become, the more you are able to hear"
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: 24.07.2025 - 23:36