Location: PHPKode > projects > Shell Providers Customer/Accounts DB > shelldb/ips/add.php
<?php include("$DOCUMENT_ROOT/includes/includes.php"); ?> 

<!-- Head -->
  <?php include("$DOCUMENT_ROOT/style/head.php"); ?>
  <!-- Navbar -->
  <?php include("$DOCUMENT_ROOT/includes/navbar.php"); ?>
  <!-- End of NavBar -->
  <IMG height=5 alt="" src="/images/blank.gif" width=100><BR>
  <!-- Body of Page -->
  <?php include("$DOCUMENT_ROOT/style/page-body.php"); ?>
<?
	if(!isset($begin_ip1))
	{
?>
<form name="ip_add" method="post" action="add.php">
  <table width="100%" border="0">
    <tr> 
      <td width="39%">Start IP</td>
      <td width="10%"> 
        <input type="text" name="begin_ip1">
      </td>
      <td width="15%"> 
        <input type="text" name="begin_ip2">
      </td>
      <td width="15%"> 
        <input type="text" name="begin_ip3">
      </td>
      <td width="21%"> 
        <input type="text" name="begin_ip4">
      </td>
    </tr>
    <tr> 
      <td width="39%">End IP</td>
      <td width="10%">
        <input type="text" name="end_ip1">
      </td>
      <td width="15%">
        <input type="text" name="end_ip2">
      </td>
      <td width="15%">
        <input type="text" name="end_ip1">
      </td>
      <td width="21%">
        <input type="text" name="end_ip4">
      </td>
    </tr>
  </table>
  <p align="center"> 
    <input type="submit" name="Submit" value="Submit">
  </p>
</form>

<? 
	}
	else {
	
	if(!is_admin()) {
	echo '<a href="/login.php">Sorry please login as a administrator</a>';
	exit;
	}
	
	mysql_connect ($shelldb_host, $shelldb_user, $shelldb_pass);
	mysql_select_db ($shelldb_db);
	
	for ($i=$begin_ip4; $i <= $end_ip4; $i++) {
		$ip = $begin_ip1 . "." . $begin_ip2 . "." . $begin_ip3 . "." . $i;
		$insert = mysql_query ("INSERT INTO ip (ip_id, ip_num, acc_id)
			           	      VALUES (NULL, '$ip', '1')
			           	      ");
	}
}

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

Return current item: Shell Providers Customer/Accounts DB