diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1bbb85b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +admin/dev_db_config.php diff --git a/admin/index.php b/admin/index.php index adda3da..a9fd501 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,9 +1,14 @@ + +
+ @@ -11,6 +16,7 @@ +Is Admin? " . $isAdmin . "
"; - - if (isset($_POST["discord"])) { - $discord = $_POST["discord"]; - } echo "+ + + + + + +
Welcome $username, please wait while we redirect you...
"; + $_SESSION["userID"] = $userID; + $_SESSION["username"] = $username; + $_SESSION["isAdmin"] = $isAdmin; + // Function from StackOverflow used to get the base URL, to which we append + // the redirect (where the user came from) + function url(){ + return sprintf( + "%s://%s/%s", + isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', + $_SERVER['SERVER_NAME'], + $_GET["redirect"] + ); + } + + $address = url(); + echo "$address
"; + + echo ""; + +} else { + echo "Invalid credentials
"; +} + + +// Close the SQL connection + $conn = null; + + ?> + + + + \ No newline at end of file diff --git a/login_page.php b/login_page.php new file mode 100644 index 0000000..777efee --- /dev/null +++ b/login_page.php @@ -0,0 +1,39 @@ + + + + + + + + + + +