42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php define("SITE_ROOT", dirname(__FILE__)); ?>
|
|
|
|
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<?php include(SITE_ROOT . "/templates/" . "head.tpl.php"); ?>
|
|
|
|
<body>
|
|
|
|
<div id="wrapper">
|
|
<h1>Database Setup</h1>
|
|
|
|
<?php
|
|
|
|
$host = $_POST["host"];
|
|
$rpassword = $_POST["rpassword"];
|
|
$name = $_POST["name"];
|
|
$user = $_POST["user"];
|
|
$password = $_POST["password"];
|
|
|
|
require_once(SITE_ROOT . "/models/" . "database.php");
|
|
$database = new Database();
|
|
$db = $database->connect();
|
|
|
|
if ($db == 0) {
|
|
echo "Installation already done!";
|
|
} else {
|
|
echo "<form action='install.php' method='post'>";
|
|
echo "Database host:<br /><input type='text' name='host' value='$host' /><br /><br />";
|
|
echo "Database root password:<br /><input type='text' name='rpassword' value='$rpassword' /><br /><br />";
|
|
echo "Database name:<br /><input type='text' name='name' value='$name' /><br /><br />";
|
|
echo "Database user:<br /><input type='text' name='user' value='$user' /><br /><br />";
|
|
echo "Database password:<br /><input type='text' name='password' value='$password' /><br /><br />";
|
|
echo "<input type='submit' value='Install' />";
|
|
echo "</form>";
|
|
}
|
|
?>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|