<?php
include("dbset.php");

$con = mysqli_connect("localhost",$dbu,$dbp);
if (!$con)
  {
  die('Could not connect to database: ' . mysqli_error());
  }
   
mysqli_select_db($con, $dbs);

date_default_timezone_set('Africa/Gaborone');
$entry_date = date("Y-m-d H:i:s", time()); 

$cx =$_GET['cx'];

$address_1 = $_GET['ip_text1'];
$address_2 = $_GET['ip_text2'];
$address_3 = $_GET['ip_text3'];
$address_4 = $_GET['ip_text4'];
$address_5 = $_GET['ip_text5'];


$table_name = "ip_address";
$address_query = "UPDATE $table_name SET ip_address = '".$address_1."' WHERE address_no = '1' ";
$address_result = $con->query($address_query);

$address_query = "UPDATE $table_name SET ip_address = '".$address_2."' WHERE address_no = '2' ";
$address_result = $con->query($address_query);

$address_query = "UPDATE $table_name SET ip_address = '".$address_3."' WHERE address_no = '3' ";
$address_result = $con->query($address_query);

$address_query = "UPDATE $table_name SET ip_address = '".$address_4."' WHERE address_no = '4' ";
$address_result = $con->query($address_query);

$address_query = "UPDATE $table_name SET ip_address = '".$address_5."' WHERE address_no = '5' ";
$address_result = $con->query($address_query);



?>


<script language="javascript" type="text/javascript">
         window.location="admin_settings.php?s=1&cx=<?php echo $cx ?>";
</script>
