mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-05-28 06:13:12 +00:00
Adding Json config
This commit is contained in:
parent
8713a6321a
commit
b261368a9b
18 changed files with 285 additions and 519 deletions
|
@ -5,13 +5,33 @@
|
|||
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 = "192.168.0.79:3306";
|
||||
$conn_username = "uwu";
|
||||
$conn_password = "fennec621";
|
||||
$conn_database = "gallery";
|
||||
|
||||
/*
|
||||
$conn_ip = $database['ip'].":".$database['port'];
|
||||
$conn_username = $database['username'];
|
||||
$conn_password = $database['password'];
|
||||
$conn_database = $database['database'];
|
||||
|
||||
echo $_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['SCRIPT_NAME']);
|
||||
echo $_SERVER['PHP_SELF'];
|
||||
*/
|
||||
|
||||
$conn = mysqli_connect($conn_ip, $conn_username, $conn_password , $conn_database);
|
||||
if ($conn->connect_error) {
|
||||
echo "<script>sniffleAdd('Error','Could not make a connection to the server, please try again later','var(--red)','".$root_dir."../../assets/icons/warning.svg')</script>";
|
||||
?>
|
||||
<script>
|
||||
sniffleAdd('Error','Could not make a connection to the server, please try again later','var(--red)','assets/icons/warning.svg');
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
/*
|
||||
Start session
|
||||
|
||||
This is important as most pages use the PHP session and will complain if its not possible to access.
|
||||
*/
|
||||
session_start();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue