Laatste bewerkte bestanden
b.v.
index.php - 15 april
downloads.php - 17 september
...
snappen jullie wat ik bedoel en is dit mogelijk ?
probeer zoiets als dit maareens
$var = `ls -l`;
en dan met een regexp de data eruit halen
Da's niet mooi: en heb je overigens geen shell access voor nodig.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
$dir = "/tmp/";
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "filename: $file : filetype: " . filetype($dir . $file) . "\n";
echo "$file was last modified: " . date ("F d Y H:i:s.", filemtime($file)
}
closedir($dh);
}
}
?>
$dir = "/tmp/";
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "filename: $file : filetype: " . filetype($dir . $file) . "\n";
echo "$file was last modified: " . date ("F d Y H:i:s.", filemtime($file)
}
closedir($dh);
}
}
?>
2 seconden php.net.
filemtime, helemaal vergeten :X
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
$dir = "uploads/";
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "filename: $file : filetype:" ;
echo filetype($dir . $file);
echo "$file was last modified:";
echo date ("F d Y H:i:s.", filemtime($file));
}
closedir($dh);
}
}
?>
$dir = "uploads/";
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "filename: $file : filetype:" ;
echo filetype($dir . $file);
echo "$file was last modified:";
echo date ("F d Y H:i:s.", filemtime($file));
}
closedir($dh);
}
}
?>
je kan het resultaat niet werkend hier zien
(link weghelaald omdat het al werkt)
Gewijzigd op 09/04/2004 14:26:00 door Bram Z
-rw-r--r-- 1 80 che-live 70597 Apr 7 14:38 1.jpg
-rw-r--r-- 1 80 che-live 5223 Apr 7 14:38 1.mini.jpg
-rw-r--r-- 1 80 che-live 31000 Apr 7 14:39 2.jpg
-rw-r--r-- 1 80 che-live 2392 Apr 7 14:39 2.mini.jpg
-rw-r--r-- 1 80 che-live 54383 Apr 7 14:39 3.jpg
-rw-r--r-- 1 80 che-live 4085 Apr 7 14:39 3.mini.jpg
echo date ("F d Y H:i:s.", filemtime($file));
in
echo date ("F d Y H:i:s.", filemtime($dir . $file));
HET WERKT heel erg bedankt de lay out pas ik wel aan en al
http://che-lives-clan.com/test/Testpage.php
maar hoe sorteer je en zet je er een limiet op
(sorteren op datum)
Gewijzigd op 09/04/2004 13:18:00 door Bram Z
array_multisort() gebruiken
sory maar ik heb nooit met arrays kunnen werken :-( kun je het ff voor mij doen
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?
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[]=$value['date'];
}
}
closedir($dh);
}
}
asort($date);
array_multisort($date,SORT_ASC,SORT_NUMERIC,$files);
foreach($files as $value){
echo 'Filename: '.$value['name'].' :: Filetype: '.$value['type'].' :: Last modified: '.$value['date']."\n";
}
?>
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[]=$value['date'];
}
}
closedir($dh);
}
}
asort($date);
array_multisort($date,SORT_ASC,SORT_NUMERIC,$files);
foreach($files as $value){
echo 'Filename: '.$value['name'].' :: Filetype: '.$value['type'].' :: Last modified: '.$value['date']."\n";
}
?>
http://che-lives-clan.com/test/Testpage.php
kan het ook via datum
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
<?php
$dir = "../";
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[]=$value['date'];
}
}
closedir($dh);
}
}
asort($date);
array_multisort($date,SORT_ASC,SORT_NUMERIC,$files);
foreach($files as $value){
if($value['type']=="file"){
$value['date']=date("H:i \- d.m.Y",$value['date']);
echo 'Filename: '.$value['name'].' :: Last modified: '.$value['date']."<br>\n";
}
}
?>
$dir = "../";
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[]=$value['date'];
}
}
closedir($dh);
}
}
asort($date);
array_multisort($date,SORT_ASC,SORT_NUMERIC,$files);
foreach($files as $value){
if($value['type']=="file"){
$value['date']=date("H:i \- d.m.Y",$value['date']);
echo 'Filename: '.$value['name'].' :: Last modified: '.$value['date']."<br>\n";
}
}
?>
het is zeker wel gesorteerd op datum
btw misschien makkelijker om het in een tabel te zetten?
maar hij was zeker te weten op datum net, tenminste toen ik keek wel
sorry kwas er zelf wat aan het prutsen maan nu staat het weer als op de site
probeer deze maar:
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 = './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 = './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>";
}
}
?>
RICK
vree merci voor het helpen het werkt nu