-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall.php
50 lines (40 loc) · 1.28 KB
/
install.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php include('header.php');
include('installer/db_text.php');
include('installer/write_db_text.php');
use RAMP\Util\Database;
try {
$db = Database::getInstance();
$flash_message = <<<EOT
<div class="inner-area">
<div id="flash_message">
<div class="success-message">
<p>Successfully connected to MySQL. <a href="index.php">Start using RAMP.</a></p>
</div>
</div>
</div>
EOT;
} catch (mysqli_sql_exception $e) {
$flash_message = <<<EOT
<div class="inner-area">
<div id="flash_message">
<div class="error-message">
<p>Couldn't connect to the MySQL server. Please <a href="install.php">configure your database settings.</a>
</p>
</div>
</div>
</div>
EOT;
}
?>
<?php
if (isset($_POST['db_user'])) {
// Force refresh after post
echo "<meta http-equiv='refresh' content='0'>";
$writeDbText($dbText($_POST['db_host'],$_POST['db_user'],$_POST['db_pass'],$_POST['db_default'],$_POST['db_port']));
}
?>
<?php include('installer/form.php'); ?>
<?php if(isset($flash_message)) {
echo $flash_message;
} ?>
<?php include('footer.php') ?>