script herkent dir niet als dir
dit script:
----
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?
// This is the directory to list files for.
$theDirectory = "dir"; //default: .
//own scandir
$dir = $theDirectory;
$dirlist = scandir($dir);
//print_r($dirlist);
echo "<table><tr><td>type</td><td>name</td><td>dir</td></tr>";
echo "<tr><td colspan='3'align='right'style='color: #FF0000;'>alles</td></tr>";
foreach ($dirlist as $hit){
$type = filetype($hit);
$path = realpath($hit);
echo "<tr>";
echo "<td>".$type."</td>";
echo "<td>".$hit."</td>";
echo "<td>".$path."</td>";
echo "</tr>";
}
echo "<tr><td colspan='3'align='right'style='color: #FF0000;'>alleen dirs</td></tr>";
foreach ($dirlist as $dir){
if (filetype($dir) == 'dir'){
echo "<tr><td>map</td><td>".$dir."</td><td>n.v.t.</td></tr>";
if (($dir !== ".") and ($dir !== "..")){
//echo "<tr><td colspan='3'>vervolg<td></tr>";
$subdirlist = scandir($dir);
foreach ($subdirlist as $subhit){
$subtype = filetype($subhit);
$subpath = realpath($subhit);
echo "<tr>";
echo "<td>".$subtype."</td>";
echo "<td>".$subhit."</td>";
echo "<td>".$subpath."</td>";
echo "</tr>";
}
}
}
}
echo ("</table>");
?>
// This is the directory to list files for.
$theDirectory = "dir"; //default: .
//own scandir
$dir = $theDirectory;
$dirlist = scandir($dir);
//print_r($dirlist);
echo "<table><tr><td>type</td><td>name</td><td>dir</td></tr>";
echo "<tr><td colspan='3'align='right'style='color: #FF0000;'>alles</td></tr>";
foreach ($dirlist as $hit){
$type = filetype($hit);
$path = realpath($hit);
echo "<tr>";
echo "<td>".$type."</td>";
echo "<td>".$hit."</td>";
echo "<td>".$path."</td>";
echo "</tr>";
}
echo "<tr><td colspan='3'align='right'style='color: #FF0000;'>alleen dirs</td></tr>";
foreach ($dirlist as $dir){
if (filetype($dir) == 'dir'){
echo "<tr><td>map</td><td>".$dir."</td><td>n.v.t.</td></tr>";
if (($dir !== ".") and ($dir !== "..")){
//echo "<tr><td colspan='3'>vervolg<td></tr>";
$subdirlist = scandir($dir);
foreach ($subdirlist as $subhit){
$subtype = filetype($subhit);
$subpath = realpath($subhit);
echo "<tr>";
echo "<td>".$subtype."</td>";
echo "<td>".$subhit."</td>";
echo "<td>".$subpath."</td>";
echo "</tr>";
}
}
}
}
echo ("</table>");
?>
----
herkent de dir dir_twee niet als dir. wat doe ik fout online voorbeeld --> (http://test.steunpunt.nexethosting.com/)
wie helpt mij?
Ivar
P.S. zijn er ook bb/html tags om een link te maken. (hier op het forum dus)
Gewijzigd op 01/01/1970 01:00:00 door Ivar
is_dir().
Voor je PS zie de FAQ.
Voor je PS zie de FAQ.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?
error_reporting(E_ALL);
// This is the directory to list files for.
$theDirectory = "dir"; //default: .
//own scandir
$dir = $theDirectory;
$dirlist = scandir($dir);
//print_r($dirlist);
echo "<table><tr><td>type</td><td>name</td><td>dir</td></tr>";
echo "<tr><td colspan='3'align='right'style='color: #FF0000;'>alles</td></tr>";
foreach ($dirlist as $hit){
//$type = filetype($hit);
$type = "file";
$pretype = is_dir($hit);
if ($pretype == TRUE){$type = "dir";}
$path = realpath($hit);
echo "<tr>";
echo "<td>".$type."</td>";
echo "<td>".$hit."</td>";
echo "<td>".$path."</td>";
echo "</tr>";
}
echo "<tr><td colspan='3'align='right'style='color: #FF0000;'>alleen dirs</td></tr>";
foreach ($dirlist as $dir){
//if (filetype($dir) == 'dir'){
if ($type == "dir"){
echo "<tr><td>map</td><td>".$dir."</td><td>n.v.t.</td></tr>";
if (($dir !== ".") and ($dir !== "..")){
//echo "<tr><td colspan='3'>vervolg<td></tr>";
$subdirlist = scandir($dir);
foreach ($subdirlist as $subhit){
//$subtype = filetype($subhit);
$subtype = "file";
$presubtype = is_dir($hit);
if ($presubtype == TRUE){$type = "dir";}
$subpath = realpath($subhit);
echo "<tr>";
echo "<td>".$subtype."</td>";
echo "<td>".$subhit."</td>";
echo "<td>".$subpath."</td>";
echo "</tr>";
}
}
}
}
echo ("</table>");
?>
error_reporting(E_ALL);
// This is the directory to list files for.
$theDirectory = "dir"; //default: .
//own scandir
$dir = $theDirectory;
$dirlist = scandir($dir);
//print_r($dirlist);
echo "<table><tr><td>type</td><td>name</td><td>dir</td></tr>";
echo "<tr><td colspan='3'align='right'style='color: #FF0000;'>alles</td></tr>";
foreach ($dirlist as $hit){
//$type = filetype($hit);
$type = "file";
$pretype = is_dir($hit);
if ($pretype == TRUE){$type = "dir";}
$path = realpath($hit);
echo "<tr>";
echo "<td>".$type."</td>";
echo "<td>".$hit."</td>";
echo "<td>".$path."</td>";
echo "</tr>";
}
echo "<tr><td colspan='3'align='right'style='color: #FF0000;'>alleen dirs</td></tr>";
foreach ($dirlist as $dir){
//if (filetype($dir) == 'dir'){
if ($type == "dir"){
echo "<tr><td>map</td><td>".$dir."</td><td>n.v.t.</td></tr>";
if (($dir !== ".") and ($dir !== "..")){
//echo "<tr><td colspan='3'>vervolg<td></tr>";
$subdirlist = scandir($dir);
foreach ($subdirlist as $subhit){
//$subtype = filetype($subhit);
$subtype = "file";
$presubtype = is_dir($hit);
if ($presubtype == TRUE){$type = "dir";}
$subpath = realpath($subhit);
echo "<tr>";
echo "<td>".$subtype."</td>";
echo "<td>".$subhit."</td>";
echo "<td>".$subpath."</td>";
echo "</tr>";
}
}
}
}
echo ("</table>");
?>
maar zie hier het werkt niet.