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