Scholieren.com forum

Scholieren.com forum (https://forum.scholieren.com/index.php)
-   Software & Hardware (https://forum.scholieren.com/forumdisplay.php?f=20)
-   -   [PHP] includen (https://forum.scholieren.com/showthread.php?t=569268)

deathz0rz 16-08-2003 00:26

[PHP] includen
 
ik krijg nu deze errors:

Warning: main(./content/sitemap.php) [function.main]: failed to create stream: No such file or directory in ./content/5.php on line 2

Warning: main() [function.main]: Failed opening './content/sitemap.php' for inclusion (include_path='.:..:include:../include:../../include') in ./content/5.php on line 2


terwijl ./include/sitemap.php toch wel degelijk bestaat

(./content/5.php wordt door ./include/search_cahce.php door ./test.php geincluded)

Manuzhai 16-08-2003 00:29

Volgens mij zegt-ie dat ./content/5.php niet kan includen in ./content/5.php? Daar lijkt het in ieder geval op.

deathz0rz 16-08-2003 00:41

test.php:
PHP-code:

define('DEBUG',true);
include_once((
DEBUG?'../':'')."include/common.php");
include_once(
"include/config.php");
//....
include_once("search_cache.php");
//.... 

include/common.php:
PHP-code:

$SDIR=getcwd();
//.... 


include/config.php:
PHP-code:

//....
ini_set('include_path','.:..:include:../include:../../include');
//.... 

include/search_cache.php:
PHP-code:

if ($handle opendir(getcwd().'/content/')) {
    while (
false !== ($file readdir($handle))) { 
        if (
preg_match('!^[0-9]*\.php$!',$file)) {
            
ob_start();
            include(
'content/'.$file);
            
$r[substr($file,0,-4)]=ob_get_contents();
            while (@
ob_end_clean());
        }
    }

    
closedir($handle); 
}

//.... 

content/5.php:
PHP-code:

include($SDIR '/content/sitemap.php');
//.... 

ik zie de fout denk ik al.... :S, ik gebruikt tegenwoordig include_path, en niet meer $SDIR, dus daar zit de fout, sitemap.php staat niet meer op die plek, vaag dat het nog werkt ;) (*check* ow het werkt ook gewoon niet)


Alle tijden zijn GMT +1. Het is nu 07:31.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.