Now I am able to use UPDOWN.CGI script in my .php website, idea is to read ips from my database and use these IPs to create PNG (UP, DOWN) file in a table. here is my .php file for other peoples.
<?php
$user_name = "root"; $password = "mypassword"; $database = "mydatabase"; $server = "127.0.0.1"; $db_handle = mysql_connect($serve, $user_name, $password); $db_found = mysql_select_db($database,$db_handle);
if ($db_found) {
$SQL = "SELECT IP FROM mydbtable LIMIT 0, 254"; $result = mysql_query($SQL);
while ($row = mysql_fetch_row($result)) { foreach($row as $cell) ;
$cgi = "<IMG src=/cgi-bin/updown.cgi?host=".$cell." &mode=icmp>" ; echo "<table border='1'> <tr> <td> .$cell. </td> <td> .$cgi. </td> </tr> </table>"; } mysql_close($db_handle); } else { print "Database NOT Found "; }
with the help of this .php file I am able to see which IP of my network is UP and which one is DOWN. all IPs read from mysql database.
Rizwan.
|