RE: [PHP] files
| From: | Don Read | Date: | Wed, 23 May 2001 14:34:34 +0000 |
| Subject: | RE: [PHP] files | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-54069@lists.php.net to get a copy of this message | ||
On 23-May-01 Jon Yaggie wrote:
> Okay I am making a small script for a web design company. What it does so
> far is take info - name, email, username,, pasword - which as all inputted
> by the designer. Then it creates a directory clients/$username on the
> company's server for the temp home of the clients web site. The design then
> ftps all files into this directory. Other than index.html I have no idea
> what the other files will be. so here is the problem
>
> I need to find the last update of one of any file in clients/$username.
> With out specificly knowing any of the filenames. As i can see there is no
> way for my script to list the files in this directory and there is no
> function to test for modifications of all files in a fiven directory.
>
> in the end i want that when the client logs in the script can spit out "you
> website was last updated -----"
>
> Ideas?
$cmd ='ls -t $dirname | head -1';
$p=popen($cmd, 'r');
$fname=fgetss($p,1000);
$mt=filemtime($fname);
pclose($p);
echo $fname, ' modified on ', strftime('%b %e, %G', $mt);
Regards,
--
Don Read dread@texas.net
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.