<?php
$ver = shell_exec("sudo netstat -an | grep $ip:$port | grep ESTABLISHED | awk '{print $5}' | cut -d: -f1");
preg_match_all("!(?:[0-9]{1,3}\.){3}[0-9]{1,3}!si", $ver, $cikti);
foreach ($cikti[0] as $yazdir) {
echo "Online: $yazdir<hr />";
}
?>
İşine yarar umarım
Edit :
<table class="listtable" cellspacing="0">
<thead>
<tr>
<th><h3>Username</h3></th>
<th><h3>Channel</h3></th>
<th><h3>IP</h3></th>
<th><h3>Location</h3></th>
<th><h3>User Agent</h3></th>
<th><h3>Date Started</h3></th>
<th><h3>Online Time</h3></th>
<th><h3>Options</h3></th>
</tr>
</thead>
<?php
include('config/mysql.php');
$ver = shell_exec("sudo netstat -an | grep $ip:$port | grep ESTABLISHED | awk '{print $5}' | cut -d: -f1");
preg_match_all("!(?:[0-9]{1,3}\.){3}[0-9]{1,3}!si", $ver, $cikti);
$birlestir = implode(",", $cikti[0]);
$result = mysql_query("SELECT * FROM connected_clients WHERE ip IN (" . $birlestir . ") ORDER BY id DESC");
while ($row = mysql_fetch_array($result)) {
$connection = $row["status"];
$username = $row["user"];
$channel = $row["port"];
$ipaddress = $row["ip"];
$useragent = $row["useragent"];
$start_time = $row["time-in"];
$dateend = $row["time-out"];
$timeonline = get_time_difference($start_time, $end_time);
$bandwidth = $row["bandwidth"];
?>
<tbody>
<tr>
<td><?php echo $username ?></td>
<td><?php echo $channel ?></td>
<td><?php echo $ipaddress ?></td>
<td><?php echo $isp ?></td>
<td><?php echo $useragent ?></td>
<td><?php echo $start_time ?></td>
<td><?php echo $timeonline ?></td>
<td>Delete</td>
<?php } ?>
</tr>
</tbody>
</table>
Cok tesekkürler. Ilk verdiginiz örnek calisiyor. Fakat ikincisinde mysql sorgusuna gelen ip'ler dogru oldugu halde calismiyor. Herhangi bir hata'da göstermiyor.