<?php
require('config.php');
?>
<html>
<head>
<script type="text/javascript">
<?php
if(isset($_REQUEST['do'])){
$where_clause="WHERE ";
while (list($key,$val) = each($_REQUEST)) {
$field_len = strlen($val);
if(in_array($key,$db_s_field) && $field_len > 0){
switch($key){
case 'ftp_port':
$where_clause.="$key = '$val' and ";
break;
default:
$where_clause.="$key LIKE '%$val%' and ";
}
}
}
$where_clause = isset($where_clause)?substr($where_clause,0,-4):"";
$link = mysql_connect($db_server, $db_user, $db_pass) or die(mysql_error());
mysql_select_db($ftpmonitor_db) or die(mysql_error()) ;
$rs = mysql_query("SELECT * from $ftpmonitor_tbl $where_clause") or die(mysql_error($link)."<br>");
$totalfound = mysql_num_rows($rs);
mysql_close($link);
echo "parent.document.getElementById('cmt').lastChild.nodeValue = 'Found'\n";
echo "parent.document.getElementById('cmtval').lastChild.nodeValue = '$totalfound Servers'\n";
echo "alert('$totalfound')\n";
}
?>
</script>
</head>
<body>
<form>
</form>
</body>
</html>