added user existence check to forum
This commit is contained in:
parent
6257ba0d52
commit
9ac2f5c563
11
forum.php
11
forum.php
@ -1,12 +1,21 @@
|
||||
<?php
|
||||
|
||||
include("./res/global.php");
|
||||
session_start();
|
||||
|
||||
if (!isset($_SESSION["username"]))
|
||||
if (!isset($_SESSION["username"])) goto fail;
|
||||
|
||||
$out = $database -> query("SELECT username FROM user WHERE BINARY username=\"" . $_SESSION["username"] . "\"");
|
||||
|
||||
if ($out -> num_rows != 1)
|
||||
{
|
||||
fail:
|
||||
echo "nope";
|
||||
header("Location: ./index.php");
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="cs">
|
||||
<head>
|
||||
|
Loading…
x
Reference in New Issue
Block a user