-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.php
59 lines (57 loc) · 1.53 KB
/
register.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
<?php
require_once('./header.php');
require_once('./commonlib.php');
$conn=getConnection('ibabymall');
$user_list = user_list($conn);
?>
<form class="form-inline" id="new_account">
<label class="control-label">新增帳號</label>
<div class="form-group">
<label class="control-label">帳號:</label>
<input class="form-control" name="account" type="text">
</div>
<div class="form-group">
<label class="control-label">密碼:</label>
<input class="form-control" name="password" type="password">
</div>
<button class="btn btn-success">新增</button>
</form>
<script>
$(document).ready(function(){
$("#new_account").submit(function(){
form = $(this);
$.ajax({
url: 'register_ajax.php',
type: 'post',
data: form.serialize(),
success: function(msg){
form[0].reset();
location.reload(false);
}
});
return false;
});
});
</script>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>#</th>
<th>帳號</th>
</tr>
</thead>
<tbody>
<?php
for($i = 0 ; $i < sizeof($user_list) ; $i++){
echo
"<tr>" .
"<td>" . $user_list[$i]["id"] . "</td>" .
"<td>" . $user_list[$i]["account"] . "</td>" .
"</tr>";
}
?>
</tbody>
</table>
<?php
require_once('./footer.php');
?>