GuiEnrik

Gerenciador de Tarefas

Sep 9th, 2026
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.11 KB | None | 0 0
  1. <?php
  2.  
  3. // Tarefa 1
  4.  
  5. if (isset($_POST['opcao'])) {
  6.  
  7.     $opcao = $_POST['opcao'];
  8.     $tarefa = $_POST['tarefa'];
  9.  
  10.     if ($opcao == "adicionar") {
  11.  
  12.         // Tarefa 2
  13.  
  14.         echo "Tarefa adicionada com sucesso!";
  15.  
  16.     }
  17.  
  18.    
  19.     if ($opcao == "remover") {
  20.  
  21.         // Tarefa 3
  22.         $encontrado = false;
  23.  
  24.         if ($encontrado) {
  25.  
  26.             // Tarefa 4
  27.  
  28.             // Tarefa 5
  29.  
  30.             echo "Tarefa removida com sucesso!";
  31.  
  32.         } else {
  33.  
  34.             echo "Tarefa não encontrada!";
  35.  
  36.         }
  37.     }
  38. }
  39.  
  40. ?>
  41.  
  42. <!DOCTYPE html>
  43. <html lang="pt-BR">
  44.  
  45. <head>
  46.     <meta charset="UTF-8">
  47.     <title>Gerenciador de Tarefas</title>
  48. </head>
  49.  
  50. <body>
  51.  
  52. <h1>Gerenciador de Tarefas</h1>
  53.  
  54. <form method="post">
  55.  
  56.     <label>Tarefa:</label>
  57.  
  58.     <input type="text" name="tarefa">
  59.  
  60.     <br><br>
  61.  
  62.     <button type="submit" name="opcao" value="adicionar">
  63.         Adicionar Tarefa
  64.     </button>
  65.  
  66.     <button type="submit" name="opcao" value="remover">
  67.         Remover Tarefa
  68.     </button>
  69.  
  70. </form>
  71.  
  72. <hr>
  73.  
  74. <h2>Tarefas</h2>
  75.  
  76. <?php
  77.  
  78. // Tarefa 6
  79.  
  80. ?>
  81.  
  82. </body>
  83. </html>
  84.  
Advertisement
Add Comment
Please, Sign In to add comment