-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.php
101 lines (89 loc) · 2.51 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
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
<?php
session_start();
if (!isset($_SESSION['username'])) {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chat App - Sign Up</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<link rel="stylesheet"
href="css/style.css">
<link rel="icon" href="img/logo.png">
</head>
<body class="d-flex
justify-content-center
align-items-center
vh-100">
<div class="w-400 p-5 shadow rounded">
<form method="post"
action="app/http/signup.php"
enctype="multipart/form-data">
<div class="d-flex
justify-content-center
align-items-center
flex-column">
<img src="img/logo.png"
class="w-25">
<h3 class="display-4 fs-1
text-center">
Sign Up</h3>
</div>
<?php if (isset($_GET['error'])) { ?>
<div class="alert alert-warning" role="alert">
<?php echo htmlspecialchars($_GET['error']);?>
</div>
<?php }
if (isset($_GET['name'])) {
$name = $_GET['name'];
}else $name = '';
if (isset($_GET['username'])) {
$username = $_GET['username'];
}else $username = '';
?>
<div class="mb-3">
<label class="form-label">
Name</label>
<input type="text"
name="name"
value="<?=$name?>"
class="form-control">
</div>
<div class="mb-3">
<label class="form-label">
User name</label>
<input type="text"
class="form-control"
value="<?=$username?>"
name="username">
</div>
<div class="mb-3">
<label class="form-label">
Password</label>
<input type="password"
class="form-control"
name="password">
</div>
<div class="mb-3">
<label class="form-label">
Profile Picture</label>
<input type="file"
class="form-control"
name="pp">
</div>
<button type="submit"
class="btn btn-primary">
Sign Up</button>
<a href="index.php">Login</a>
</form>
</div>
</body>
</html>
<?php
}else{
header("Location: home.php");
exit;
}
?>