I got some code that executes with value's inside a $_GET
and some code that checks for an active session. Yet, when I go to the link directly without active session it still executes the function and after that returns to the login page.
My code:
My loginheader:
<?php
session_start();
if (!isset($_SESSION['Username'])|| $_SESSION["Actief"] == 0||
$_SESSION["Actief"] == 2) {
return header("Location: main_login.php");
exit();
}
My webpage (only the needed code):
require "../loginheader.php";
require "../AdminOnlyHeader.php";
// --some code with sql instructions--
$result = ExecuteQuery($sql);`
AdminOnlyHeader
is just to check for admin status. This too seems to be bypassed by just entering a link.
So if you still don't understand what I mean, here's a short summary of what I do:
- I make one of those links that contain the get data needed to execute it;
- I log out and get returned to the login page;
- I enter the the link I made before;
- After some loading I am still on the login page but when I look at my database I see that the record has been updated and thus the function (
ExecuteQuery
) was executed.