-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
170 lines (165 loc) · 5.55 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?php
include_once 'db_connection.php';
error_reporting(0);
session_start();
$name=$_POST['name'];
$email=$_POST['email'];
$pass=$_POST['pass'];
if($name || $email || $pass)
{
//checking that the email-id already exists or not
$query=" SELECT * FROM `users` WHERE email = '$email' ";
$uid_info=mysqli_query($conn, $query);
$row=mysqli_fetch_assoc($uid_info);
if(!$row){ // if the email id is not present then the new value is entered
$query="INSERT INTO `users` (`name`,`email`,`pass`) VALUES ('$name','$email','$pass')";
if(mysqli_query($conn, $query)){
$query=" SELECT * FROM `users` WHERE email = '$email' ";
$uid_info=mysqli_query($conn, $query);
$row=mysqli_fetch_assoc($uid_info);
$_SESSION['USERID']=$row['uid'];
}
}else{
echo '<script>alert("the email id already exists");</script>';
}
}
if($_SESSION['USERID']){
header("refresh:1, url=http://localhost/practice/confess/dashboard.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Confess | Signup</title>
</head>
<script src="animation.js"></script>
<body>
<div class="major-menu-container" id="area-for-menu">
<div
class="the-menu-container"
onclick="menuRetract()"
id="menu-background"
>
<center>
<ul>
<li onclick="boxAppear(1)"><a href="#">Instruction</a></li>
<li onclick="boxAppear(2)"><a href="#">About</a></li>
<li onclick="boxAppear(3)"><a href="#">Contact</a></li>
</ul>
</center>
</div>
</div>
<div class="major-menu-container" id="area-for-info">
<div
class="the-info-container"
onclick="infoRetract()"
id="info-background"
>
<center>
<div id="info2">
<h3>About</h3>
<br />
<p>
this is just a small initiation which allows other people to
confess any thing which they want to the one who has an account
and has shared the link via a social media.
</p>
<p>
There is also a personal diary type available for the user where
they can write anything they want to keep a track of their daily
life or anything happening to them.
</p>
</div>
<div id="info3">
<h3>Contact</h3>
<br />
<h5>Know the developer:</h5>
<br />
<p>Ex-student of methodist school</p>
<p>XD XD XD</p>
</div>
<div id="info1">
<h3>Instruction</h3>
<br />
<ul>
<li>make an account</li>
<li>copy the link on the dashboard</li>
<li>share it on any social media or to your friends</li>
<li>
the link will lead them to a textbox where they will be able to
confess.
</li>
</ul>
</div>
</center>
</div>
</div>
<!--making the header color idea -->
<div class="container" id="header">
<center>
<div class="content" id="header-content">
<img class="logo" src="logo2.png" />
<div class="nav-container">
<i class="fas fa-bars" onclick="menuAppear()"></i>
</div>
</div>
</center>
</div>
<div class="container" id="main">
<center>
<div class="content-form" id="main-content">
<form action="signup.php" method="POST">
<table>
<caption>
Welcome!
</caption>
<tr>
<td><input class="input" type="text" placeholder="Name" name="name" id="inp_name" /></td>
</tr>
<tr>
<td><input class="input" type="text" placeholder="Email" name="email" id="inp_email" /></td>
</tr>
<tr>
<td>
<input class="input" type="password" placeholder="Password" name="pass" id="inp_pass" />
</td>
</tr>
<tr>
<td>
<center>
<input
class="button"
type="submit"
value="Signup"
id="form-btn"
/>
</center>
</td>
</tr>
<tr>
<td>
<center>
<p id="small-instruction">
Already have an account?
<i><a href="Login.php">Login</a></i>
</p>
</center>
</td>
</tr>
</table>
</form>
</div>
</center>
</div>
<div class="container" id="footer">
<p id="footer-point-1">
<i class="far fa-copyright"></i> 2020 Copyright:Confess.xyz
</p>
<p id="footer-point-2">An <em>Ex-Methodistian</em> production</p>
</div>
</body>
</html>