Fixed key word error
This commit is contained in:
parent
dd66573508
commit
e1e879e94b
|
@ -19,7 +19,7 @@ if(isset($_POST['login'])){
|
|||
if(password_verify($password, $hashedPassword )){
|
||||
$_SESSION['groupName'] = $groupName;
|
||||
$_SESSION['success'] = "You are now logged in";
|
||||
header('location: Main.php?login=success');
|
||||
header('location: ../Frontend/group.php?login=success');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ class KeyWord extends Eloquent{
|
|||
|
||||
|
||||
public function group(){
|
||||
return $this->hasOne(Group::class);
|
||||
return $this->belongsTo(Group::class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
require "../bootstrap.php";
|
||||
use Backend\Models\Group;
|
||||
use Backend\Models\KeyWord;
|
||||
|
||||
|
||||
if(isset($_POST['submitKeyWord'])){
|
||||
$keyword = new KeyWord();
|
||||
|
||||
$keyword->keyWord = $_POST['key_word'];
|
||||
|
||||
$keyword->group()->associate(Group::find($_POST['group_id']));
|
||||
|
||||
if(!$keyword->save()){
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
/*
|
||||
require "../bootstrap.php";
|
||||
*/
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue