-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.php
47 lines (41 loc) · 1.39 KB
/
setup.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
<?php
// Reset session.
session_start();
session_destroy();
include_once('dbSearcher/header.php');
$file_result = false;
if (isset($_POST['submit_creds'])) {
// 3306 default port.
if (empty($_POST['port']))
$_POST['port'] = 3306;
$file_result = $dbSearcher->set_config($_POST['hostname'], $_POST['username'], $_POST['password'], (int)$_POST['port']);
}
?>
<?php if ($file_result !== FALSE){ ?><script type="text/javascript">window.location = '/index.php';</script><?php } ?>
<div class="container">
<div class="form-container">
<h1>Database Searcher Setup</h1>
<form method="post" action="./setup.php">
<div class="field-group">
<label>Hostname:</label>
<input type="text" id="hostname" name="hostname" />
</div>
<div class="field-group">
<label>Username:</label>
<input type="text" id="username" name="username" />
</div>
<div class="field-group">
<label>Password:</label>
<input type="password" id="password" name="password" />
</div>
<div class="field-group">
<label>Port:</label>
<input type="text" id="port" name="port" />
</div>
<div class="submit-group">
<input type="submit" name="submit_creds" />
</div>
</form>
</div>
</div>
<?php include_once('dbSearcher/footer.php'); ?>