Location: PHPKode > projects > Tcpdb > tcpdb/subnet/index.php
<html>
<font face='verdana' color='#00066' size=5><strong>Subnet</strong>
<form ACTION="index.php" method=GET>
<hr>
<p>
<table summary="">
<tr>
<td><font face='verdana' color='#00066' size=2>A</td>
<td><font face='verdana' color='#00066' size=2>B</td>
<td><font face='verdana' color='#00066' size=2>C</td>
<td><font face='verdana' color='#00066' size=2>D</td>
<td><font face='verdana' color='#00066' size=2>To</td>
<td><font face='verdana' color='#00066' size=2>Subnet Name</td>
<td><font face='verdana' color='#00066' size=2>Location</td>
</tr>
<tr>
<td><input type='text' name='a' size='3' maxlength='3'>&nbsp;</td>
<td><input type='text' name='b' size='3' maxlength='3'>&nbsp;</td>
<td><input type='text' name='c' size='3' maxlength='3'>&nbsp;</td>
<td><input type='text' name='d' size='3' maxlength='3'>&nbsp;->&nbsp;</td>
<td><input type='text' name='e' size='3' maxlength='3'>&nbsp;</td>
<td><input type=text name=subnet_name size=30 maxlength=100></td>
<td><select name="location">


<?php

require '../config.php';

echo "<option value='--Select--'>--Select-- </option>";
      
$sql = mysql_query("SELECT location FROM location ORDER BY location");
    while ($res = mysql_fetch_array($sql)) {
		       $location = $res["location"];					 
	
				 
echo "<option value='$location'>$location </option>";
}

?>
</td>
<td><input type="submit" value="Add" name="add"></td>
</tr>

</table>
<hr>
<?php

$a = $HTTP_GET_VARS["a"];
$b = $HTTP_GET_VARS["b"];
$c = $HTTP_GET_VARS["c"];
$d = $HTTP_GET_VARS["d"];
$e = $HTTP_GET_VARS["e"];
$subnet_name = $HTTP_GET_VARS["subnet_name"];
$location = $HTTP_GET_VARS["location"];

if ($add)
{
mysql_query ("INSERT INTO subnet (tcpip, subnet_name, location) VALUES ('$a.$b.$c.$d','$subnet_name','$location')"); 

 $sql = mysql_query("SELECT * FROM subnet where subnet_name like '$subnet_name' and location like '$location'");

    while ($res = mysql_fetch_array($sql)) {
		$subnet_id = $res["subnet_id"];
    

}
for ($d=$d; $d<=$e; $d++)
//echo "$a.$b.$c.$d<br>";

mysql_query ("INSERT INTO tcpip (tcpip, sort, subnet_id) VALUES ('$a.$b.$c.$d','$d','$subnet_id')");

}

require 'list_subnet.php';
?>
Return current item: Tcpdb