-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathregForm.php
58 lines (54 loc) · 2.19 KB
/
regForm.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
<?php include_once 'header.html'; ?>
<div class="col-md-3"></div>
<div class="border-form col-md-6">
<label class="col-sm-2"><h2><b>Registration</b></h2></label><br><br><br><br>
<form class="form-horizontal" method="POST">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Login</label>
<div class="col-sm-5">
<input type="text" class="form-control" name="login" id="inputEmail3" placeholder="Login">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-5 control-label">Password</label>
<div class="col-sm-5">
<input type="password" class="form-control" name="password" id="inputPassword3" placeholder="Password">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-5 control-label">Email</label>
<div class="col-sm-5">
<input type="text" class="form-control" name="email" id="inputPassword3" placeholder="Email">
</div>
</div>
<div class="form-group">
<div class="center-block">
<a href="autForm.php" style="margin:5px;" class="btn btn-default">Back</a>
<button style="margin:5px;" type="submit" class="btn btn-success">Sign up</button>
</div>
</div>
</form>
</div>
<div class="col-md-3"></div>
<?php
include_once 'footer.html';
include_once('library/db.php');
include_once ('library/createAgent.php');
include_once('library/validate.php');
include_once 'library/showMessage.php';
if (isset($_POST['login']) && isset($_POST['password']) && isset($_POST['email'])){
$status = createAgent(getConnect(), $_POST["login"], $_POST["password"], $_POST["email"]);
if($status===true)
{
successMessage("You are registered!");
}
elseif($status===-1)
{
warningMessage("Enter correct data!");
}
else
{
warningMessage("User with login " . $_POST['login'] . " is already exist!");
}
}
?>