Dodaj 'delete.php'

This commit is contained in:
Krystian Rzepa 2018-12-30 00:18:56 +00:00
parent c26af931e2
commit 448c0b9b74

17
delete.php Normal file
View File

@ -0,0 +1,17 @@
<?php
session_start();
$db_servername = 'localhost';
$db_login_tasks = '';
$db_password_tasks = '';
$db_name_tasks = '';
$db = mysqli_connect("$db_servername", "$db_login_tasks", "$db_password_tasks", "$db_name_tasks");
if (isset($_GET['del_task']) && $_SESSION['zalogowany'] = true) {
$login = $_SESSION['login'];
$id = $_GET['del_task'];
mysqli_query($db, "DELETE FROM `tasks_$login` WHERE ID = $id");
}
header('Location: index.php');
?>