[prev in list] [next in list] [prev in thread] [next in thread]
List: php-general
Subject: [PHP] Search directory
From: hadi <almarzuki2011 () hotmail ! com>
Date: 2014-06-21 22:19:22
Message-ID: DUB123-DS128CDE2EEA2262667E2E97B31D0 () phx ! gbl
[Download RAW message or body]
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);
}
}
}
}
?>
["smime.p7s" (application/pkcs7-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic