Configuration file

This commit is contained in:
Daniel Løvbrøtte Olsen 2016-05-14 23:35:09 +02:00
parent 0e709efcae
commit 98fff1b107
3 changed files with 14 additions and 17 deletions

4
blomzt/config.ini Normal file
View File

@ -0,0 +1,4 @@
[database]
db_host = localhost
db_user = root
db_password =

View File

@ -1,7 +0,0 @@
<? php
return array(
'db_host' => 'localhost'
'db_username' => 'root'
'db_password' => 'password'
);

View File

@ -1,6 +1,14 @@
<?php <?php
$config = include('config.php'); $config = parse_ini_file('config.ini');
$conn = mysqli_connect($config['db_host'], $config['db_user'], $config['db_password'], 'blomzt');
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
?> ?>
@ -8,17 +16,9 @@ $config = include('config.php');
<html> <html>
<head> <head>
<title>CSGO skin database</title> <title>Blomzt</title>
</head> </head>
<body> <body>
<?php
$con = mysqli_connect($config.db_host, $config.db_username, $config.db_password);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connection succeded";
?>
</body> </body>
</html> </html>