-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.php
More file actions
48 lines (42 loc) · 1.55 KB
/
setup.php
File metadata and controls
48 lines (42 loc) · 1.55 KB
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
<!DOCTYPE HTML>
<?PHP
require_once 'functions.php';
session_start();
if(isset($_POST['dbSetup'])){
// Sanitize user input
$_SESSION['db_host'] = sanitize($_POST['db_host']);
$_SESSION['db_user'] = sanitize($_POST['db_user']);
$_SESSION['db_pass'] = sanitize($_POST['db_pass']);
$_SESSION['db_name'] = sanitize($_POST['db_name']);
$_SESSION['db_type'] = sanitize($_POST['db_type']);
// Create Database
require "setup_dbcreate.php";
// Forward to setup-dbimport.php
header ('Location:setup_dbimport.php');
}
?>
<html>
<?PHP includeHead('Microfinance Management', 0) ?>
<link rel="stylesheet" type="text/css" href="css/setup.css" />
</head>
<body>
<div class="content_center">
<img src="ico/mangoo_l.png" style="width:380px; margin-top:3em; margin-bottom:2em;"/>
<p class="heading">mangoO Setup Assistant</p>
<div class="setup">
<p>Database Setup</p>
<form action="setup.php" method="post" onsubmit="return validate(this)">
<input type="text" name="db_host" placeholder="Database Host" required="required" />
<input type="text" name="db_user" placeholder="Database User" required="required" />
<input type="password" name="db_pass" placeholder="Database Password" />
<input type="text" name="db_name" placeholder="Database Name" required="required" />
<select name="db_type">
<option value="1">Fresh Database</option>
<option value="2">Test Database</option>
</select>
<input type="submit" name="dbSetup" value="Setup" />
</form>
</div>
</div>
</body>
</html>