Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

ahjoyo / idc0007

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • icd007
  • delete.php
Find file
BlameHistoryPermalink
  • mhasan's avatar
    added edit page. · 989c66a2
    mhasan committed 6 years ago
    989c66a2
delete.php 1.15 KB
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
<?php
require "db_conn.php";
session_start();
$e = null;

if (isset($_POST['submit'])) {
        try {
            $query_st = sprintf("DELETE FROM %s WHERE taskID ='%d';", $_SESSION['userName'], $_POST['taskID']);
            $pdo->exec($query_st);
        } catch (PDOException $e) {
            echo ($e->getMessage() . " " . $e->getLine());
        }
    }

?>


<!DOCTYPE html>
<html lang="en-US">

<head>
    <link rel="stylesheet" href="css/view.css">
    <meta charset="UTF-8">
    <meta name="description" content="ICD0007 Project, Todo List">
    <title> View Tasks</title>
</head>

<body>
    <nav class="nav">
        <a href="index.php"> Index </a> &nbsp; &nbsp;
        <a href="register.php"> Register </a>&nbsp; &nbsp;
        <a href="create.php"> Create List </a>&nbsp; &nbsp;
        <a href="view.php"> View List</a>&nbsp; &nbsp;
        <a href="delete.php"> DELETE Tasks </a>&nbsp; &nbsp;
        <a href="faq.php"> FAQ </a>&nbsp; &nbsp;
    </nav>

    <h2> DELETE tasks </h2>
    <form method="POST">
        Enter Task ID :<input type="number" name="taskID">
        Submit :<input type="submit" name="submit" value="submit">
    </form>
</body>

</html>