-
Notifications
You must be signed in to change notification settings - Fork 15
/
registration.php
56 lines (51 loc) · 1.47 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
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<link rel="stylesheet" href="registration.css" />
</head>
<body>
<div class="bg-image">
<img src="cyber2.jpg" class = "image">
</div>
<div class="login">
<?php
require('db.php');
if (isset($_POST['username']))
{
$var = 0;
if(isset($_POST['Email']))
{
$username = ($_POST['username']);
$Email = ($_POST['Email']);
$password = ($_POST['password']);
if(!filter_var($Email, FILTER_VALIDATE_EMAIL))
{
$msg = 'The Email you have entered is invalid, please try again.';
echo $msg;
}else{
$query = "INSERT INTO `users` (`username`, `password`, `Email`) VALUES ('$username', '$password', '$Email');";
$result1 = mysqli_query($conn,$query);
if($result1)
{
echo "<div class='form'>
<h3>You are registered successfully.</h3>
<br/>Click here to start <a href='start.php'>Login</a></div>";
}
}
$conn->close();
}
}
else{
?>
<div class="form">
<h1>Register Here!!</h1>
<form name="registration" action="" method="post">
<input type="text" name="username" placeholder="username" required />
<input type="Email" name="Email" placeholder="Email" required />
<input type="password" name="password" placeholder="Password" required />
<input type="submit" name="submit" value="Click me to Register" />
</form>
</div>
<?php } ?>
</body>
</html>