0
0

Moved all configurations away from $GLOBALS to independent variables

This commit is contained in:
Bryan Pedini
2019-07-18 11:38:03 +02:00
parent f2a56c2abc
commit 68884270f3
9 changed files with 44 additions and 44 deletions

View File

@@ -19,7 +19,7 @@
echo ( json_encode ( $response ) );
exit;
}
$database = new Database ( $GLOBALS [ 'config' ] [ 'db' ] );
$database = new Database ( $config [ 'db' ] );
$database->connect ( );
$database->prepare ( "UPDATE `links` SET `URL`=:url WHERE `ID`=:url_id;" );
$database->bind ( [ ':url' => $_POST [ 'url' ], 'url_id' => $_POST [ 'url_id' ] ] );

View File

@@ -19,7 +19,7 @@
echo ( json_encode ( $response ) );
exit;
}
$database = new Database ( $GLOBALS [ 'config' ] [ 'db' ] );
$database = new Database ( $config [ 'db' ] );
$database->connect ( );
$url = $_POST [ 'url' ];
$database->prepare ( "INSERT INTO `links` ( `URL`, `created_by` ) VALUES ( :url, " . $_SESSION [ 'user_id' ] . " );" );

View File

@@ -1,3 +1,3 @@
<?php
$_SESSION [ 'user_id' ] = NULL;
header ( "Location: " . substr ( $_SERVER [ 'SCRIPT_NAME' ], 0, -10 ) . "/" );
header ( "Location: " . $config [ 'installation_path' ] . "/" );