-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete_action.php
37 lines (33 loc) · 1.03 KB
/
delete_action.php
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
<?php
session_start();
$id_user = $_SESSION['id_user'];
include 'db.php';
$id_note = $_POST['id_note'];
if(mysql_query("DELETE FROM notes WHERE id='$id_note';", $link)) {
if( mysql_query( "DELETE FROM reminders WHERE id='$id_note';", $link ) )
echo 'Deleted note successfully.' . '<br>';
else {
include "src/head.php";
include "src/header.php";
echo '<p>Error: cannot execute \'delete\' query in reminders after clicking delete button.</p>' . mysql_error($link) . '<br>';
// include "src/mainmenu.php";
include "src/footer.php";
include "src/bottom.php";
// mysql_close($link);
exit;
}
}
else {
include "src/head.php";
include "src/header.php";
echo '<p>Error: cannot execute \'delete\' query in notes after clicking delete button.</p>' . mysql_error($link) . '<br>';
// include "src/mainmenu.php";
include "src/footer.php";
include "src/bottom.php";
// mysql_close($link);
exit;
}
header('Location: private.php');
mysql_close($link);
// die();
?>