Repository navigation
Expand file tree
/
Copy pathsignUp.php
More file actions
69 lines (67 loc) · 2.15 KB
/
Copy pathsignUp.php
File metadata and controls
69 lines (67 loc) · 2.15 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<doctype html>
<html>
<head>
<title>sign up page</title>
</head>
<body>
<form name="join" method="post" action="memberSave.php">
<h1>input your information</h1>
<table border="1">
<tr>
<td>ID</td>
<td><input type="text" size="30" name="userID"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" size="30" name="PW"></td>
</tr>
<tr>
<td>Confirm Password</td>
<td><input type="password" size="30" name="PW1"></td>
</tr>
<tr>
<td>name</td>
<td><input type="text" size="12" maxlength="10" name="name"></td>
</tr>
<tr>
<td>address</td>
<td><input type="text" size="40" name="address"></td>
</tr>
<tr>
<td>phone</td>
<td><input type="text" size="40" name="phone"></td>
</tr>
</table>
<button type="submit" class="btn btn-info" onclick="RegisterUser()">회원가입<i class="fa fa-check spaceLeft"></i></button>
<input type=reset value="rewrite">
</form>
</body>
</html>
<script>
function RegisterUser() {
if (document.getElementById("PW").value == document.getElementById("PW1").value) {
var request = new XMLHttpRequest();
var params = "?userID=" + document.getElementById("userID").value + "&PW=" + document.getElementById("PW").value
+ "&name=" + document.getElementById("name").value + "&address=" + document.getElementById("address").value
+ "&phone=" + document.getElementById("phone").value;
request.open("GET", "register_user.php" + params, true);
request.onreadystatechange = function () {
if (request.readyState == 4) { //서버로부터 응답상태
if (request.status == 200 || request.status == 0) {//200 : 웹 서버의 응답처리상태
var str = request.responseText;
if (str == "1") {
alert("Success!!");
}
else {
alert("Fail!!");
}
}
}
}
request.send(null);
}
else {
alert("Passwords not same");
}
}
</script>