-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreate-account.php
68 lines (62 loc) · 2.39 KB
/
create-account.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
<?php
//include('classes/DB.php');
header("Location: /SushiNetwork/create-account.html"); // new page
//
//if (isset($_POST['createaccount'])) {
// $username = $_POST['username'];
// $password = $_POST['password'];
// $email = $_POST['email'];
//
// if (!DB::query('SELECT username FROM users WHERE username=:username', array(':username' => $username))) {
//
// if (strlen($username) >= 3 && strlen($username) <= 32) {
//
// if (preg_match('/[a-zA-Z0-9_]+/', $username)) {
// if (strlen($password) >= 6 && strlen($password) <= 60) {
// if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
// if (!DB::query('SELECT email FROM users WHERE email=:email', array(':email' => $email))) {
// DB::query('INSERT INTO users (username, password, email)VALUES (:username, :password, :email)', array(
// ':username' => $username,
// ':password' => password_hash($password, PASSWORD_BCRYPT),
// ':email' => $email
// ));
// echo "Success"; // ECHO
// } else {
// echo "email exists"; //ECHO
// }
// } else {
// echo "invalid email"; // ECHO
// }
// } else {
// echo "Invalid password"; // ECHO
// }
// } else {
// echo "Invalid username"; // ECHO
// }
// } else {
// echo "Invalid username"; // ECHO
// }
// } else {
// echo "Already exist"; // ECHO
// }
//}
?>
<!--
<html>
<head>
<title>SSN:Create A new Account</title>
<meta charset="utf-8">
</head>
<body>
<div class="regForm">
<h1>Register here</h1>
<form action="create-account.php" method="post">
<input type="text" name="username" placeholder="username....">
<input type="password" name="password" placeholder="password....">
<input type="email" name="email" placeholder="[email protected]">
<input type="submit" name="createaccount" value="Create Account">
</form>
</div>
</body>
</html>
-->