Laat eens zien hoe je het bestand nu include?
Link gekopieerd
Hier is mijn volledige code van de pagina:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>DejaVu Reportage</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="/includes/fotofadein.js"></script>
</head>
<body>
<?php
$arrStr = explode("/", $_SERVER['SCRIPT_NAME'] );
$arrStr = array_reverse($arrStr );
?>
<?php
ini_set('display_errors', 1); // 0 = uit, 1 = aan
error_reporting(E_ALL);
$talen = array('NL' => array('titel' => '<div id="tekst_rechts"><h2 align="right">Nieuwe foto´s</h2>',
'menu' => 'menu_nl.php'),
'ENG' => array('titel' => '<div id="tekst_rechts"><h2 align="right">New pictures</h2>',
'menu' => 'menu_eng.php'),
);
if(isset($_GET['LANG']) and isset($talen[$_GET['LANG']]))
{
$language = $_GET['LANG'];
}
else
{
$language = 'NL';
}
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="nl">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>DejaVu Reportage</title>
<link href="/css/dejastyle2.css" rel="stylesheet" type="text/css" media="screen" />';
include('../includes/metatags.inc');
echo '<script type="text/javascript" src="/includes/fotofadein.js"></script>
</head>
<body>
<div id="distance"></div>
<div id="container">
<div id="language"><a href="';
echo $arrStr[0];
echo '?LANG=NL">nederlands</a> / <a href="';
echo $arrStr[0];
echo '?LANG=ENG">english</a></div>
<div align="center"><table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td id="content_cell">';
echo $talen[$language]['titel'];
require "dirlisting.php";
echo '</div><div id="NEW">';
if(!isset($_GET["naam"])){;
echo '<img src="/images/intro_new.jpg" width="400" height="300" />';
} else {;
echo '<iframe style="border: medium none ; background-color:FFFFFF;" src="/NEW/<?php PRINT $_GET["naam"]; ?>/iframe.html" title="Slideshow" frameborder="0" height="370" width="500" scrolling="no"></iframe>';
};
echo '</div>';
include($talen[$language]['menu']);
echo '</div>
</td>
</tr>';
include('footer.inc');
echo '
</table>
</div>
</body>
</html>
';
?>
En hier de dirlisting.php
function getFiles($path) {
//Function takes a path, and returns a numerically indexed array of associative arrays containing file information,
//sorted by the file name (case insensitive). If two files are identical when compared without case, they will sort
//relative to each other in the order presented by readdir()
$files = array();
$fileNames = array();
$i = 0;
if (is_dir($path)) {
if ($dh = opendir($path)) {
while (($file = readdir($dh)) !== false) {
if ($file == "." || $file == "..") continue;
$fullpath = $path . "/" . $file;
$fkey = strtolower($file);
while (array_key_exists($fkey,$fileNames)) $fkey .= " ";
$a = stat($fullpath);
$files[$fkey]['size'] = $a['size'];
if ($a['size'] == 0) $files[$fkey]['sizetext'] = "-";
else if ($a['size'] > 1024) $files[$fkey]['sizetext'] = (ceil($a['size']/1024*100)/100) . " K";
else if ($a['size'] > 1024*1024) $files[$fkey]['sizetext'] = (ceil($a['size']/(1024*1024)*100)/100) . " Mb";
else $files[$fkey]['sizetext'] = $a['size'] . " bytes";
$files[$fkey]['name'] = $file;
$files[$fkey]['type'] = filetype($fullpath);
$fileNames[$i++] = $fkey;
}
closedir($dh);
} else die ("Cannot open directory: $path");
} else die ("Path is not a directory: $path");
sort($fileNames,SORT_STRING);
$sortedFiles = array();
$i = 0;
foreach($fileNames as $f) $sortedFiles[$i++] = $files[$f];
return $sortedFiles;
}
$files = getFiles("./NEW");
foreach ($files as $file) print "<a href=\"new.php?naam=$file[name]\">$file[name]</a><br>\n";
Link gekopieerd
Mijn god wat stom....
Ik heb in de dirlisting vergeten de <??> te plaatsen
Ik dacht dat dat niet nodig was...
Alles werkt nu !!!
Link gekopieerd