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
|
<?php
|
||||||
|
|
||||||
|
include("./res/global.php");
|
||||||
session_start();
|
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");
|
header("Location: ./index.php");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="cs">
|
<html lang="cs">
|
||||||
<head>
|
<head>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user