Search directory
| From: | hadi | Date: | Sat, 21 Jun 2014 22:19:22 +0000 |
| Subject: | Search directory | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-323503@lists.php.net to get a copy of this message | ||
Hi,
Can some body lookup and fix my code please.
What exactly I need is "$ip" variable should look into "$iplookup"
directory and locate its ip file.
"$ip" variable it pass to the funcation along with the "$username" as you
can see in my code.
But im not able to fix how "$ip" well search "$iplookup" directory. And get
the ip file match to it.
<?php
function timeout($username, $ip)
{
$iplookup = glob('/var/log/phplogs/iplogs/');
foreach(glob('/tmp/sess*') as $file) {
if (time()- filemtime($ip) > 60)
{
$old = "$username";
$content = file_get_contents($file);
if(strpos($content, $old) !== false) {
unlink($file);
}
}
}
}
?>
Attachment: [application/pkcs7-signature] smime.p7s
Attachment: [application/pkcs7-signature] smime.p7s