[PHP] probelem with script
/* what i'm trying to do is read the files and folders in the directory and output them into an xml document - when i try to find the size of the file i get an error - can someone please tell me why this is thanks mike */ // SCRIPT [dir.php] ";// open the folder tag and put the folder name in it chdir($file); // change to that directory folder2XML(); // make our recursive call to display this directory too. chdir("../"); // change back to previous directory echo ""; // close the folder tag } else { // if it's a file... // the error is bieng caused here $size = int filesize($file) echo ""; // if you comment out the above 2 lines and include the below instead it works // echo ""; } } } closedir($fp); // close the open directory } echo(""); ?> // END -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] what is the format of the filemtime string
i am trying to find out when my files were last modified (accessing all files on the server is not a problem) to try and find this i am using: filemtime($file) - but this ruturns a string - 1015171598 what is the format of the string? - are there ways to return the last modified data in the format "Tue, 19, 200, 20:53" (something along that line? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] what is the format of the filemtime string
tight i have tried what you said: $last_mod = filemtime($file); $tdate = date($last_mod); but now the output is in this format - c707-b076 sorry to be ask again but can you give me more of a clue as you've probably guessed - i'm a novice thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] listing the files in the directory
hi, i'm pretty new to php - i am trying to list/print a list of files and folders that are on my server: from my little knowledge i have got: http://mysite.com/";; $handle = opendir($dir); while (($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "- " . $file . ""; } } ?> i keep getting errors - will this code list the files on my site? thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] listing the files in the directory
well do you think you can point me in the right direction to listing the files on my site? - is it possible (as i said i am very new to this) thanks -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: 24 May 2002 19:09 To: [EMAIL PROTECTED] Subject: Re: [PHP] listing the files in the directory On Saturday 25 May 2002 02:01, _michael wrote: > hi, i'm pretty new to php - i am trying to list/print a list of files and > folders that are on my server: > > from my little knowledge i have got: > > $dir = "http://mysite.com/";; > $handle = opendir($dir); > while (($file = readdir($handle))) { > if ($file != "." && $file != "..") { > echo "- " . $file . ""; > } > } > ?> > > i keep getting errors - will this code list the files on my site? No. You can only opendir() a local filesystem. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* It's clever, but is it art? */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php