-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathregistration.php
69 lines (61 loc) · 2.11 KB
/
registration.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
<?php require("config.php");
session_start();
global $message_code;
$return = false;
if (!empty($_SESSION['email'])) {
header("location:home.php");
}
if(isset($_POST['registration'])) {
$email = $_POST['email'];
$username = $_POST['username'];
$password = md5($_POST['password']);
$return = user_registration($email, $username, $password);
if ($return != '2') {
echo "<script type='text/javascript'>alert('{$message_code[$return]}');</script>";
}
else{
echo "<script type='text/javascript'>;";
echo "alert('{$message_code[$return]}');";
echo "window.location.href='login.php';";
echo "</script>";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="container">
<header>
<h1>Registration</h1>
</header>
<!-- Form Section -->
<form id="register" action="" method="post">
<div class="form-group">
<label id="email-label" for="email">Email</label>
<input type="email" name="email" id="email" placeholder="Enter your Email" required />
</div>
<br />
<div class="form-group">
<label id="username-label" for="username">Username</label>
<input type="text" name="username" id="username" placeholder="Enter your Usename" required />
</div>
<br />
<div class="form-group">
<label id="password-label" for="password">Password</label>
<input type="password" name="password" id="password" placeholder="Enter your Password" required />
</div>
<br />
<div class="form-group">
<button type="submit" name="registration" id="submit" class="submit-register"><h2>Registration</h2>
</button>
</div>
</form>
<br />
<p>Already have an account? <a href="login.php">Login here!</a></p>
</div>
</body>
</html>