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

sopham / todolist

  • 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
  • todolist
  • index_php.php
Find file
BlameHistoryPermalink
  • sopham's avatar
    Initial commit · 7f53639a
    sopham committed 6 years ago
    7f53639a
index_php.php 438 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<?php
  if(isset($_POST['logout'])) {
    session_name($user);
    session_destroy();
    header('Location: login_page.php');
    exit;
  }

  if(isset($_POST['add-button'])){
    $addTask = $_POST['add-task'];
    $file = fopen("taskList.txt","a+") or die("Unable to open file");
    $s = $addTask."\r\n";
    fputs($file,$s) or die("Unable to open save");
    fclose($file);
    header('Location: index.php');
  }

?>