-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patheditlocation_sql.php
More file actions
47 lines (37 loc) · 925 Bytes
/
editlocation_sql.php
File metadata and controls
47 lines (37 loc) · 925 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
46
47
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'lfgj[eqnfrbcnfdm';
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$olt = $_GET["olt"];
$mac = $_GET["mac"];
$extra = "index.php?page=onu&olt=$olt&mac=$mac";
include 'vars.php';
$conn = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
mysql_query("SET NAMES utf8");
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
if(! get_magic_quotes_gpc() )
{
$latlongmet = addslashes ($_POST['latlongmet']);
}
else
{
$latlongmet = $_POST['latlongmet'];
}
$lat = substr($latlongmet, 0, -8);
$lon = substr($latlongmet, 8);
$sql = "UPDATE onus ".
"SET lat=\"$lat\", lon=\"$lon\" WHERE mac=\"$mac\"";
mysql_select_db($mysql_db);
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not enter data: ' . mysql_error());
}
header("Location: http://$host$uri/$extra");
mysql_close($conn);
?>