HTTP werkt niet, hoe los ik dit op
Mark PHP
16/06/2004 12:40:00De $dir hieronder kan geen http:// aan. Oftewel kan je alleen refereren naar je eigen site. Hoe maak ik het script zo, dat het invoeren van http:// wel mogelijk is?
Ps script gevonden op http://www.phphulp.nl/forum/showtopic.php?id=1106&cat=1&replies=10&PHPSESSID=21cee635b0cbfea1301eb854236572d5, mocht dit van belang zijn
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
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
<?
$dir = 'http://localhost/img/naam/';
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if($file!='.'&&$file!='..'){
$files[]=array(
'name'=>$file,
'date'=>filemtime($dir.$file),
'type'=>filetype($dir.$file)
);
$date[]=filemtime($dir.$file);
}
}
closedir($dh);
}
}
array_multisort($date,SORT_DESC,$files);
echo'<table border="1">';
foreach($files as $value){
if($value['type']=="file"){
$date=$value['date'];
$value['date']=date("H:i \- d.m.Y",$value['date']);
echo '<tr><td>Filename: '.$value['name'].'</td><td>Last modified: '.$value['date']."</td></tr>";
}
}
?>
$dir = 'http://localhost/img/naam/';
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if($file!='.'&&$file!='..'){
$files[]=array(
'name'=>$file,
'date'=>filemtime($dir.$file),
'type'=>filetype($dir.$file)
);
$date[]=filemtime($dir.$file);
}
}
closedir($dh);
}
}
array_multisort($date,SORT_DESC,$files);
echo'<table border="1">';
foreach($files as $value){
if($value['type']=="file"){
$date=$value['date'];
$value['date']=date("H:i \- d.m.Y",$value['date']);
echo '<tr><td>Filename: '.$value['name'].'</td><td>Last modified: '.$value['date']."</td></tr>";
}
}
?>
Ps script gevonden op http://www.phphulp.nl/forum/showtopic.php?id=1106&cat=1&replies=10&PHPSESSID=21cee635b0cbfea1301eb854236572d5, mocht dit van belang zijn