source: trunk/cgi-bin/add-alloc.php@ 6

Last change on this file since 6 was 6, checked in by Kris Deugau, 20 years ago

Add intermediate development files for posterity

File size: 631 bytes
Line 
1<?php
2/* add-alloc.php
3** Quick hack to allow manual editing of data in postgres:via_ipdb:allocations table
4** -> add allocation to table
5** 07/13/2004 kdeugau@vianet
6*/
7 $dbh = pg_connect("dbname=ipdb user=ipdb");
8
9 $maskbits = explode("/", $cidr);
10
11 $qu = pg_exec($dbh, "delete from freeblocks where cidr='$cidr'");
12 $qu = pg_exec($dbh, "insert into allocations values ".
13 "('$cidr','$custid','$alloctype','$city','$desc','$notes',$maskbits[1])");
14 if (!$qu) {
15 print "INSERT failed. Check data and db.";
16 } else {
17 header("Location: http://".$HTTP_SERVER_VARS['HTTP_HOST'].
18 "/ip/cgi-bin/edit-alloc.php");
19 }
20?>
Note: See TracBrowser for help on using the repository browser.