subnet_id . '">' . $row->subnet_address . '/' . $row->subnet_mask . '
'; } return $subnet; } // displaysubnet link (or not) if (isset($_GET['displaysubnet'])) { $displaysubnetlink = '(hide subnets)'; } else { $displaysubnetlink = '(display subnets)'; } // "menu" function display_children($parent, $level) { $result = mysql_query("SELECT location_id, location_name FROM location WHERE parent='$parent' ORDER BY location_name"); while ($row = mysql_fetch_object($result)) { if (isset($_GET['displaysubnet'])) { $displaysubnet = display_subnet($row->location_id); } else { $displaysubnet = ''; } echo '' . str_repeat('   ',$level) . '' . $row->location_name . ' ' . $displaysubnet . ''; display_children($row->location_id, $level+1); } } ?>
Location: