|
|
@ -9,11 +9,14 @@ $statement = $session->prepare('SELECT * FROM DATA WHERE user=? AND shortlink=?
|
|
|
|
$result = $session->execute($statement,array('arguments' => array($_SESSION['user'],$_POST['link'])));
|
|
|
|
$result = $session->execute($statement,array('arguments' => array($_SESSION['user'],$_POST['link'])));
|
|
|
|
$row_id = $result[0]['id'];
|
|
|
|
$row_id = $result[0]['id'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (empty($row_id) || empty($_POST['link']) || empty($_SESSION['user'])) {
|
|
|
|
|
|
|
|
http_response_code(500);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$statement = $session->prepare('UPDATE data USING TTL 0 SET hell=false, shortlink=?, url=?, user=?, latitude=?, longitude=?, radius=? WHERE id=?;');
|
|
|
|
$statement = $session->prepare('UPDATE data USING TTL 0 SET hell=false, shortlink=?, url=?, user=?, latitude=?, longitude=?, radius=? WHERE id=?;');
|
|
|
|
$new_result = $session->execute($statement,array('arguments' => array($_POST['link'], $result[0]['url'], $result[0]['user'], $result[0]['latitude'], $result[0]['longitude'], $result[0]['radius'], $row_id)));
|
|
|
|
$new_result = $session->execute($statement,array('arguments' => array($_POST['link'], $result[0]['url'], $result[0]['user'], $result[0]['latitude'], $result[0]['longitude'], $result[0]['radius'], $row_id)));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
http_response_code(204);
|
|
|
|
http_response_code(204);
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|