ctrlpanel/public/install/forms.php

31 lines
874 B
PHP
Raw Normal View History

2022-01-11 13:09:20 +00:00
<?php
include("functions.php");
if(isset($_POST['checkDB'])){
$values = [
//SETTINGS::VALUE => REQUEST-VALUE (coming from the html-form)
"DB_HOST" => "databasehost",
"DB_DATABASE" => "database",
"DB_USERNAME" => "databaseuser",
"DB_PASSWORD" => "databaseuserpass",
"DB_PORT" => "databaseport",
"DB_CONNECTION" => "databasedriver"
];
$db = new mysqli($_POST["databasehost"], $_POST["databaseuser"], $_POST["databaseuserpass"], $_POST["database"], $_POST["databaseport"]);
if ($db->connect_error) {
header("LOCATION: index.php?step=2&message=Could not connect to the Database");
die();
}
2022-01-11 13:15:09 +00:00
2022-01-11 13:09:20 +00:00
foreach ($values as $key => $value) {
2022-01-11 13:15:09 +00:00
$param = $_POST[$value];
setEnvironmentValue($key, $param);
}
2022-01-11 13:09:20 +00:00
header("LOCATION: index.php?step=3");
}
?>