Location: PHPKode > projects > Shell Providers Customer/Accounts DB > shelldb/process/ip_search.php
<?php include("$DOCUMENT_ROOT/includes/includes.php"); ?> 
<?php include("$DOCUMENT_ROOT/style/head.php"); ?> 
<?php include("$DOCUMENT_ROOT/includes/navbar.php"); ?>
<IMG height=5 alt="" src="/images/blank.gif" width=100><BR>
<?php include("$DOCUMENT_ROOT/style/page-body.php"); ?>
<!-- Beginning of script -->

<? 

if(!is_user()) {
	echo '<a href="/login.php">Sorry please login</a>';
	exit;
}

			  
			  
			  /* Connect To Database */
			 
			  mysql_connect ($shelldb_host, $shelldb_user, $shelldb_pass);
			  mysql_select_db ($shelldb_db);
			  
			 /* Determain what to search for and where */
			 
			  if($ip_num != "") {
			  	$like_ip_num = "%".$ip_num."%";
			  	$query = mysql_query("SELECT * FROM ip WHERE ip_num LIKE '$like_ip_num' order by ip_num");
			  } else {
			  	if($ip_id == "") {$ip_id = "%";}
			  	$query = mysql_query("SELECT * FROM ip WHERE ip_id LIKE '$ip_id' order by ip_num");
			  }
			 
			 /* Determain Number Of Results */
			 
			 $num_results = mysql_num_rows($query); 
			 echo "Number of  Results Found: <B> $num_results </B><BR>";
			  
			 /* Print Results */
			 
			 for ($i=0; $i <$num_results; $i++)
			 {
			 	$row = mysql_fetch_array($query);
				echo "<p><strong>".($i+1).". IP Number: ";
				echo htmlspecialchars( stripslashes($row["ip_num"]));
				echo "</strong><BR> IP ID:";
				echo htmlspecialchars( stripslashes($row["ip_id"]));
				echo "<BR> Account ID: ";
				if($row["acc_id"]=="1") 
				{
				echo "UNASSIGNED";
				} else {
				$out1 = htmlspecialchars( stripslashes($row["acc_id"]));
				echo '<A href="/reports/acc_info.php?id=' . $out1 . '">' .$out1.'</A>'; 
				}
			 }
?>


<!-- End of script -->
<?php include("$DOCUMENT_ROOT/style/page-body-end.php"); ?>
<?php include("$DOCUMENT_ROOT/includes/footer.php"); ?>
<?php include("$DOCUMENT_ROOT/style/footer.php"); ?>

          
			  
Return current item: Shell Providers Customer/Accounts DB