More work on web setup form

This commit is contained in:
Duncan Sommerville 2014-12-01 15:49:53 -05:00
parent 6838694a8b
commit acaf47c592
5 changed files with 31 additions and 38 deletions

View file

@ -1,12 +1,8 @@
<?php
foreach($_POST as $e) {
echo $e;
}
?>
<html style="background-color:#111141;">
<html style="background-color: #111141;">
<head>
<link rel="stylesheet" type="text/css" href="css/bootstrap-3.3.1.min.css">
<script type="text/javascript" src="js/libs/jquery-1.8.3.min.js"></script>
@ -17,19 +13,19 @@
<h3 style="margin: 1em 0;">Database Settings</h3>
<div class="form-group">
<label class="sr-only" for="dbUser">Database Username</label>
<input required class="form-control" type="text" id="dbUser" placeholder="Username"/>
<input required class="form-control" type="text" name="dbUser" id="dbUser" placeholder="Username"/>
</div>
<div class="form-group">
<label class="sr-only" for="dbPass">Database Password</label>
<input required class="form-control" type="password" id="dbPass" placeholder="Password"/>
<input required class="form-control" type="password" name="dbPass" id="dbPass" placeholder="Password"/>
</div>
<div class="form-group">
<label class="sr-only" for="dbName">Database Name</label>
<input required class="form-control" type="text" id="dbName" placeholder="Name"/>
<input required class="form-control" type="text" name="dbName" id="dbName" placeholder="Name"/>
</div>
<div class="form-group">
<label class="sr-only" for="dbHost">Database Host</label>
<input required class="form-control" type="text" id="dbHost" placeholder="Host" value="localhost"/>
<input required class="form-control" type="text" name="dbHost" id="dbHost" placeholder="Host" value="localhost"/>
</div>
<div class="form-group">
<input type="submit" class="btn btn-default"/>
@ -39,10 +35,10 @@
<script>
$("#dbSettingsForm").submit(function(e) {
e.preventDefault();
$.post('#', $('form').serialize(), function(data) {
var d = $('#dbSettingsForm').serializeArray();
$.post('setup/functions.php?fn=airtimeValidateDatabaseSettings', d, function(data) {
console.log(data);
});
}, "json");
});
</script>
</body>