From 21702e79f5d395e7b5a4aeb41338e849bcc83bd6 Mon Sep 17 00:00:00 2001 From: "dare@darey.io" Date: Fri, 3 Jul 2020 13:24:17 +0100 Subject: [PATCH] fix login issues --- html/create_user.php | 8 ++++---- html/db-schema.sql | 13 +++++++++++++ html/functions.php | 3 +-- html/login.php | 2 +- html/loginstyle.css | 6 +----- html/register.php | 4 ++-- 6 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 html/db-schema.sql diff --git a/html/create_user.php b/html/create_user.php index 2fbf3dec..85cdcec0 100644 --- a/html/create_user.php +++ b/html/create_user.php @@ -1,9 +1,9 @@ @@ -50,11 +50,11 @@
- +
- +
diff --git a/html/db-schema.sql b/html/db-schema.sql new file mode 100644 index 00000000..b2def4d9 --- /dev/null +++ b/html/db-schema.sql @@ -0,0 +1,13 @@ +CREATE DATABASE IF NOT EXISTS multi_login; + +USE multi_login ; + +CREATE TABLE users( + id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, + username VARCHAR(255) NOT NULL, + email VARCHAR(255) NOT NULL, + password VARCHAR(255) NOT NULL, + user_type VARCHAR (255) NOT NULL +); + +INSERT INTO users (username, password, email, user_type) VALUES ('admin', '21232f297a57a5a743894a0e4a801fc3', 'admin@admin.com', 'admin'); \ No newline at end of file diff --git a/html/functions.php b/html/functions.php index e8a098f4..3e5283cc 100644 --- a/html/functions.php +++ b/html/functions.php @@ -2,7 +2,7 @@ session_start(); // connect to database -$db = mysqli_connect('localhost', 'root', '', 'multi_login'); +$db = mysqli_connect('localhost', 'admin', 'admin.com', 'multi_login'); // variable declaration $username = ""; @@ -167,4 +167,3 @@ function isAdmin() } - diff --git a/html/login.php b/html/login.php index 48430e7b..294ab09c 100644 --- a/html/login.php +++ b/html/login.php @@ -20,7 +20,7 @@
- +
diff --git a/html/loginstyle.css b/html/loginstyle.css index 7b853f71..fb05c70a 100644 --- a/html/loginstyle.css +++ b/html/loginstyle.css @@ -110,8 +110,4 @@ input::placeholder{ } .errors{ color: #FF0000; -} - - - - +} \ No newline at end of file diff --git a/html/register.php b/html/register.php index 95695413..8d235ae2 100644 --- a/html/register.php +++ b/html/register.php @@ -22,11 +22,11 @@
- +
- +