-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.php
66 lines (59 loc) · 2.1 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
include ('inc/header.php');
include ('inc/databasehandler.php');
?>
<div id="navigation">
<ul>
<li><a href="index.php"><span>home</span></a></li>
<li><a href="notes.php"><span>notes</span></a></li>
<li><a href="credits.php"><span>credits</span></a></li>
<li><a href="contact.php"><span>contact</span></a></li>
</ul>
<div class="cl"> </div>
</div>
</div>
<!-- END Logo + Description + Navigation -->
<!-- Header -->
<div id="main">
<h2 >Database Setup</h2>
<br /><br />
<form action="<?php $_SERVER['PHP_SELF']?>" method="POST">
<table>
<tr><td align="right">Database Host:</td> <td align="left"><input type="text" name ="host"></td> </tr>
<tr><td align="right">Database User:</td> <td align="left"><input type="text" name ="user"> </td> </tr>
<tr><td align="right">Password:</td> <td align="left"><input type="password" name ="passwd"> </td> </tr>
<tr><td align="right">php.ini path:</td> <td align="left"><input type="text" name ="phpini"> </td> </tr>
<tr><td align="right">httpd.conf Path:</td> <td align="left"><input type="text" name ="httpdconf"> </td> </tr>
<tr><td align="right"><input type="submit" name="connect" value="Connect"></td></tr>
</table>
</form>
<br />
<?php
if (isset($_POST['connect'])){
$host =$_POST['host'];
$user =$_POST['user'];
$passwd =$_POST['passwd'];
$phpini=$_POST['phpini'];
$httpdconf=$_POST['httpdconf'];
$connected=connectToMySQL($host, $user, $passwd,$phpini,$httpdconf);
$db_created=CreateDB();
$tables_created=createTables();
$directives_populated=populateValues();
if ($connected && $db_created && $tables_created && $directives_populated)
{
echo "Database setup successfully completed. Please ";
}
?>
<a href="index.php"> Continue... </a>
<?php
}
?>
<br />
<!-- END Slider -->
</div>
<div id="description" class="separator"></div>
<!-- END Main -->
<!-- Footer -->
<?php
include ('inc/footer.php');
?>