forked from Webscorpion1/Snapshot
/
register.php
118 lines (99 loc) · 4.39 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
include_once("classes/User.class.php");
try{
if( !empty ($_POST['firstname']) && !empty ($_POST['lastname']) && !empty ($_POST['username']) && !empty ($_POST['email']) && !empty ($_POST['password'])){
if($_POST['password'] == $_POST['password_confirmation']) {
$user = new User();
$user->setFirstName(strip_tags($_POST['firstname']));
$user->setLastName(strip_tags($_POST['lastname']));
$user->setUsername(strip_tags($_POST['username']));
$user->setEmail(strip_tags($_POST['email']));
$user->setPassword(strip_tags($_POST['password']));
$user->setAvatar(strip_tags(""));
if($user->register()){
$user->login();
}
}
else{
$error_confirmation = "Passwords don't match";
}
}
}
catch (Exception $e){
$error_confirmation = $e->getMessage();
}
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Register - Snapshot</title>
<meta name="description" content="snapshot" />
<meta name="keywords" content="snapshot, imd" />
<meta name="author" content="Lucas Debelder, Jasmina Dahou, Sander Verbesselt, Frederik Delaet" />
<link href="https://fonts.googleapis.com/css?family=Montserrat:600,800|Open+Sans" rel="stylesheet">
<script defer src="https://use.fontawesome.com/releases/v5.0.4/js/all.js"></script>
<link rel="stylesheet" type="text/css" href="css/reset.css" />
<link rel="stylesheet" type="text/css" href="css/normalize.css" />
<link rel="stylesheet" type="text/css" href="css/master.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" href="https://cssgram-cssgram.netdna-ssl.com/cssgram.min.css">
<meta property="og:url" content="">
<meta property="og:type" content=""/>
<meta property="og:title" content=""/>
<meta property="og:description" content=""/>
<meta property="og:image" content=""/>
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="">
<meta name="twitter:creator" content="">
<meta name="twitter:title" content="">
<meta name="twitter:description" content=" ">
<meta name="twitter:image" content="">
</head>
<body class="login">
<div class="grid container_login">
<div class="login_grid">
<form class="form_login" action="" method="post">
<h1>Get started absolutely free.</h1>
<h2>Enter your details below.</h2>
<div>
<label for="firstname">FIRST NAME</label><br/>
<input class="form__input" type="text" id="firstname" name="firstname" placeholder="Lucas" required>
</div>
<div>
<label for="lastname">LAST NAME</label><br/>
<input class="form__input" type="text" id="lastname" name="lastname" placeholder="Debelder" required>
</div>
<div>
<label for="email">USERNAME</label><br/>
<input class="form__input" type="text" id="username" name="username" placeholder="ZanicL3" required>
</div>
<div>
<label for="email">EMAIL</label><br/>
<input class="form__input" type="email" id="email" name="email" placeholder="Lucasdebelder@snapshot.be" required>
</div>
<div>
<label for="password">PASSWORD</label><br/>
<input class="form__input" type="password" id="password" name="password" placeholder="Atleast 8 characters" required>
</div>
<div>
<label for="password_confirmation">CONFIRM YOUR PASSWORD</label><br/>
<input class="form__input" type="password" id="password_confirmation" name="password_confirmation" placeholder="Password confirm" required>
</div>
<?php if(isset($error_confirmation)): ?>
<div>
<p class="error_red">
<?php echo $error_confirmation ?>
</p>
</div>
<?php endif; ?>
<div>
<input type="submit" value="REGISTER" class="btn_style">
</div>
<p class="center_align">Already have an account?</p>
<br/>
<a class="center_align" href="login.php">Login here.</a>
</form>
</div>
</body>
</html>