From 089afaa61031936cb8656942f7839189a1f3fe78 Mon Sep 17 00:00:00 2001 From: Leander Date: Mon, 27 Mar 2017 14:48:02 +0200 Subject: [PATCH] T1703271447 --- register.php | 1 + start.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/register.php b/register.php index 75bd6d9..4a47c33 100644 --- a/register.php +++ b/register.php @@ -13,6 +13,7 @@ $name = $_GET['name']; $uid = md5(uniqid(rand(), true)); $database = new Database(); + if(preg_match(PATTERN, $name) != 1 or !$name) { $error = 11101; } else { diff --git a/start.php b/start.php index 7413a69..a0bf294 100644 --- a/start.php +++ b/start.php @@ -6,12 +6,12 @@ * Time: 14:07 */ - include_once includes.inc.php; - + require_once('includes.inc.php'); $uid = $_GET['uid']; $length = ($_GET['length'] && gettype(+$_GET['length']) == 'integer') ? +$_GET['length'] : 10; - $questions_count = Database::query('SELECT COUNT(*) FROM "QUESTIONS"'); + $database = new Database(); + + $questions_count = $database->query('SELECT COUNT(*) FROM "QUESTIONS"'); echo $questions_count; -?> - +?> \ No newline at end of file