-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
74 lines (71 loc) · 2.84 KB
/
signup.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
<?php
include_once 'includes/msg_handler.php';
if (!isset($_SESSION)) {
session_start();
}
if (isset($_SESSION["user_id"])) {
header("Location: .");
}
?>
<!DOCTYPE html>
<html>
<head>
<?php include_once 'frontend/head.php'; ?>
<title>Sign Up • Camagru</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/login.css">
</head>
<body style='min-height: 0'>
<?php include "frontend/header.php"; ?>
<main>
<div class='login-container'>
<div class='box'>
<section class="signup-form">
<img class="login_logo" style='margin-bottom: 1em;' src="images/logo.svg" alt="logo">
<p id='signup-welcome'>Sign up to see photos and videos from your friends.</p>
<form action="includes/signup-inc.php" method='post'>
<div class='input-container'>
<label for="name">Email</label>
<input type='text' name='email' autocomplete="email"
pattern="[A-Za-z0-9_\-.]+@([A-Za-z0-9_\-]+\.)+[A-Za-z0-9_\-.]{2,4}"
title="Invalid email pattern. '@' is at least required. for example: [email protected]" required>
</div>
<div class='input-container'>
<label for="name">Full Name</label>
<input type='text' name='name' autocomplete="fname" required
pattern="^([a-zA-Z' -]+)$" title="Only letters and spaces">
</div>
<div class='input-container'>
<label for="name">Username</label>
<input type='text' name='uid' autocomplete="username"
pattern="[a-zA-Z0-9_]{4,20}"
title="Invalid username. Lenght is between 4-20 and contains only letters, number and underscore _" required>
</div>
<div class='input-container'>
<label for="name">Password</label>
<input type='password' name='pwd' autocomplete="new-password"
pattern="(?=^.{8,}$)(?=.*\d)(?=.*[!@#$%^&*]+)(?=.*[A-Z])(?=.*[a-z]).*"
title="Invalid password format. Lenght is at least 8 character long, at least one upper- and lowercase letter, and one special character [!@#$%^&*]"
required>
</div>
<div class='input-container'>
<label for="name">Repeat Password</label>
<input type='password' name='pwd_repeat' autocomplete="new-password"
pattern="(?=^.{8,}$)(?=.*\d)(?=.*[!@#$%^&*]+)(?=.*[A-Z])(?=.*[a-z]).*"
title="Invalid password format. Lenght is at least 8 character long, at least one upper- and lowercase letter, and one special character [!@#$%^&*]"
required>
</div>
<button class='login_button' type='submit' name='submit'>Sign Up</button>
</form>
</section>
<?php if (isset($_GET['msg'])) {
echo(msg_handler($_GET['msg']));
} ?>
</div>
<div class='box' style='margin-top: 0.6em; padding-bottom: 1.5em;'>
<p id='login-text'>Have an account? <span id='signup-text' onclick="location.href = 'login'">Log in<span></p>
</div>
</div>
</main>
</body>
</html>