Advertisement
fcunha

tarefas.php

Aug 28th, 2015
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 KB | None | 0 0
  1. <?php
  2.     session_start();
  3.     //criando um array
  4.     $lista_tarefas=array();
  5.    
  6.     if(isset($_GET['nome']) && $_GET['nome'] != ''){
  7.         $tarefa = array();
  8.         $tarefa['nome'] = $_GET['nome'];
  9.        
  10.         if(isset($_GET['descricao'])){
  11.             $tarefa['descricao'] = $_GET['descricao'];
  12.            
  13.         }else{
  14.             $tarefa['descricao'] = '';
  15.         }
  16.         if(isset($_GET['prazo'])){
  17.             $tarefa['prazo'] = $_GET=['prazo'];
  18.         }else{
  19.             $tarefa['prazo']='';
  20.         }
  21.        
  22.         $tarefa['prioridade'] = $_GET['prioridade'];
  23.        
  24.        
  25.         if(isset($_GET['concluida'])){
  26.             $tarefa['concluida'] = $_GET['concluida'];
  27.         }else{
  28.             $tarefa['concluida'] = '';
  29.         }
  30.        
  31.        
  32.         $_SESSION['lista_tarefas'][]= $tarefa;
  33.         }
  34.         $lista_tarefas = $_SESSION['lista_tarefas'];
  35.    
  36.      
  37.    
  38.     if(isset($_SESSION['lista_tarefas'])){
  39.         $lista_tarefas = $_SESSION['lista_tarefas'];
  40.     }else{
  41.         $lista_tarefas = array();
  42.         }
  43.        
  44.    
  45.     //session_destroy();
  46.    
  47.     include "template.php";
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement