added delete function to th application
This commit is contained in:
parent
204e212fb8
commit
a19e40f205
7 changed files with 74 additions and 10 deletions
12
controllers/delete.php
Normal file
12
controllers/delete.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
$heading = "Delete";
|
||||
$username = "MatheApp";
|
||||
$password = "password";
|
||||
$config = require('config.php');
|
||||
$db = new Database($config['database'], $username, $password);
|
||||
|
||||
session_start();
|
||||
$db->query("DELETE FROM user WHERE username = :user", ["user" => $_SESSION['username']]);
|
||||
session_destroy();
|
||||
header("Location: /");
|
||||
exit;
|
||||
Loading…
Add table
Add a link
Reference in a new issue