mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-05-27 13:53:13 +00:00
AJAX rewrite
This commit is contained in:
parent
d003fbdf1e
commit
dc89737cfc
16 changed files with 689 additions and 184 deletions
|
@ -1,20 +1,56 @@
|
|||
<?php
|
||||
// Include required files and commands by every page on header
|
||||
/*
|
||||
Connect to database
|
||||
|
||||
In the future I want this section to be configurable, but that'll require some work to be done.
|
||||
For now it's hard-coded, shouldn't be an issue as most people wont be changing this often anyway
|
||||
*/
|
||||
// Setting up connection variables
|
||||
$conn_ip = "localhost";
|
||||
$conn_username = "uwu";
|
||||
$conn_password = "fennec621";
|
||||
$conn_database = "swag";
|
||||
|
||||
$conn = mysqli_connect($conn_ip, $conn_username, $conn_password , $conn_database);
|
||||
if ($conn->connect_error) {
|
||||
// Send notification that connection couldn't be made
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Start session
|
||||
|
||||
This is important as most pages use the PHP session and will complain if its not possible to access.
|
||||
*/
|
||||
session_start();
|
||||
|
||||
if (is_dir("ui/")) {
|
||||
include_once("ui/functions.php");
|
||||
|
||||
/*
|
||||
Check which directory user is in
|
||||
|
||||
I don't know if theres a better way of doing this? If there is please let me know
|
||||
*/
|
||||
if (is_file("index.php")) {
|
||||
$root_dir = "";
|
||||
} else {
|
||||
include_once("../ui/functions.php");
|
||||
$root_dir = "../";
|
||||
}
|
||||
|
||||
$conn = mysqli_connect("localhost", "uwu", "fennec621", "swag");
|
||||
if ($conn->connect_error) {
|
||||
echo "<p class='alert alert-low'>Could not connect to database</p>";
|
||||
}
|
||||
|
||||
/*
|
||||
Include functions
|
||||
|
||||
Maybe I should put all the functions in this file? Dunno
|
||||
*/
|
||||
include $root_dir."ui/functions.php";
|
||||
|
||||
/*
|
||||
Notification system
|
||||
|
||||
This is the notification system used by the website. Probably a little too much for what its used for
|
||||
*/
|
||||
echo "<div id='notify-root' class='notify-root'></div>";
|
||||
?>
|
||||
<script
|
||||
src="https://code.jquery.com/jquery-3.6.0.min.js"
|
||||
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
|
||||
crossorigin="anonymous">
|
||||
<script>
|
||||
console.log(" . . /|/| . . . . . . . \n .. /0 0 \\ . . . . . .. \n (III% . \\________, . . \n .. .\\_, .%###%/ \\'\\,.. \n . . . .||#####| |'\\ \\. \n .. . . ||. . .|/. .\\V. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . cc/ . .cc/ . . .");
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue