Keyword now gets its data from session, made a error pages display
This commit is contained in:
parent
5d0e60cd9d
commit
913fdae646
|
@ -3,11 +3,12 @@ require "../bootstrap.php";
|
|||
use Backend\Models\Group;
|
||||
use Backend\Models\KeyWord;
|
||||
|
||||
session_start();
|
||||
|
||||
|
||||
if(isset($_POST['submitKeyWord'])){
|
||||
if (session_status() === PHP_SESSION_ACTIVE) {
|
||||
if(isset($_POST['submitKeyWord'])){
|
||||
//Find the group id
|
||||
$group = Group::find($_POST['group_id']);
|
||||
$group = Group::find($_SESSION['groupId']);
|
||||
|
||||
//if statement to find out if the group have use all their keyWords
|
||||
if(KeyWord::where('group_id', $group->id)->count()<$group->groupAmount){
|
||||
|
@ -30,7 +31,8 @@ if(isset($_POST['submitKeyWord'])){
|
|||
}
|
||||
|
||||
//TODO make toast feedback
|
||||
}
|
||||
}else{
|
||||
header("location: ../Frontend/index.php?login=notLoggein");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
<?php
|
||||
/*
|
||||
require "../bootstrap.php";
|
||||
*/
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
@ -15,7 +10,6 @@ require "../bootstrap.php";
|
|||
|
||||
<form action="../Backend/keyWordsRemaining.php" method="POST">
|
||||
<input type="text" name="key_word" placeholder="key word">
|
||||
<input type="number" name="group_id" placeholder="group id">
|
||||
<input type="submit" name="submitKeyWord" value="Submit">
|
||||
</form>
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
print_r($_GET);
|
Loading…
Reference in New Issue