forked from v222008/PonControl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelolt.php
More file actions
45 lines (30 loc) · 826 Bytes
/
Copy pathdelolt.php
File metadata and controls
45 lines (30 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
include 'vars.php';
$extra = 'index.php';
$table = $_GET["olt"];
$ip = str_replace ("_", ".", $table);
$sql_ip = sprintf('%u', ip2long($ip));
$conn = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
mysql_query("SET NAMES utf8");
mysql_select_db($mysql_db);
$sql = "DELETE FROM olts WHERE ip='$sql_ip'";
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not enter data: ' . mysql_error());
}
$sql = "DELETE FROM onus WHERE olt='$sql_ip'";
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not enter data: ' . mysql_error());
}
$sql = "DELETE FROM onus_s WHERE olt='$sql_ip'";
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not enter data: ' . mysql_error());
}
mysql_close($conn);
header("Location: http://$host$uri/$extra?page=olt_list");
?>