-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregistration.php
More file actions
71 lines (69 loc) · 1.8 KB
/
Copy pathregistration.php
File metadata and controls
71 lines (69 loc) · 1.8 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
70
71
<?php
require_once('api/db.php');
require_once('api/user.php');
require_once('config.php');
if ($_POST['submit']) {
$user = new User();
$err = $user->registration($_POST['username'], $_POST['password1'], $_POST['password2'], $_POST['email']);
if (!$err) {
$config = new Config();
header("Location: ".$config->url);
}
}
?>
<!DOCTYPE html>
<html>
<head>
<script src="js/main.js"></script>
</head>
<body>
<div id="content">
<div>
<?
if (count($err) != 0) {
echo '<p><b>Registration was failed</b></p>';
foreach ($err as $e) {
echo $e."<br/>";
}
}
?>
</div>
<form method="POST">
<table>
<tr>
<td>
Username
</td>
<td>
<input name="username" />
</td>
</tr>
<tr>
<td>
Password
</td>
<td>
<input type="password" name="password1" />
</td>
</tr>
<tr>
<td>
Password 2
</td>
<td>
<input type="password" name="password2" />
</td>
</tr>
<tr>
<td>
Email
</td>
<td>
<input name="email" />
</td>
</tr>
</table>
<input name="submit" type="submit" value="Registration">
</form>
</div>
</body>