-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.php
144 lines (128 loc) · 6.53 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse " id="navbarSupportedContent">
<ul class="navbar-nav mr-auto ml-5">
<li class="nav-item active ml-5">
<a class="nav-link btn btn-primary" href="login.php" onclick="audio_play()">Login <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active ml-3">
<a class="nav-link" href="index.php" onclick="audio_play()">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active ml-3">
<a class="nav-link" href="contact.php" onclick="audio_play()">Contact Us <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active ml-3">
<a class="nav-link" href="blog.php" onclick="audio_play()">Rate Us/Blog<span class="sr-only">(current)</span></a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0 mr-5 " action="" method="POST">
<input class="form-control mr-sm-2 " type="search" placeholder="Search" name="search_area" aria-label="Search">
<button class="btn btn-success my-2 my-sm-0 mr-5" name="search_btn" type="submit">Search</button>
</form>
<input id="mode" type="button" class="btn btn-light" value="Dark-Mode" onclick="change()">
</div>
</nav>
<?php
if(isset($_POST['search_btn']))
{
$search_result = $_POST['search_area'];
header("location:search.php?search_result=".$search_result);
}
?>
<div class="container bg-light " style="margin-top:6%;border-radius:10px;padding:20px;box-shadow: 15px 15px 20px 20px #ddd;width:auto;">
<form action="signup.php" method="POST">
<div class="text-center"><h3 style="font-family: Stencil">Register to Mongers Club</h3></div>
<img src="images/logo.png" alt="" width="300" height="auto" style="position:relative;left:30%;">
<div class="form-group">
<input id="user_id" type="text" class="form-control text-center" name="name" placeholder="enter your username" autocomplete="off" required>
</div>
<div class="form-group">
<input id="email_id" type="email" class="form-control text-center" name="email" placeholder="enter a valid e-mail" autocomplete="off" required>
</div>
<div class="form-group">
<input id="pwd_id" type="password" class="form-control text-center" name="password" placeholder="enter your password" required>
</div>
<div class="form-group">
<input id="phone_id" type="phone" class="form-control text-center" name="phone" placeholder="enter your phone number" autocomplete="off" required>
</div>
<div class="form-group">
<input id="institute_id" type="text" class="form-control text-center" name="institute" placeholder="enter your institute (not compulsary)" autocomplete="off">
</div>
<div class="form-group">
<input id="place_id" type="text" class="form-control text-center" name="place" placeholder="enter residance place (not compulsary)" autocomplete="off">
</div>
<div class="form-check-inline" style="margin-left:40%;">
<input id="male_id" type="radio" class="form-check-input" name="gender" value="male">
<label for="male_id">Male</label>
</div>
<div class="form-check-inline">
<input id="female_id" type="radio" class="form-check-input ml-5" name="gender" value="female">
<label for="female_id">Female</label>
</div>
<br>
<br>
<div class=" form-check text-center">
<input type="checkbox" class="form-check-input mt-2" id="checkbox" required>
<label for="checkbox" class="form-check-label badge badge-danger ">Yes, i want to join the community </label>
</div>
<br>
<div class="text-center">
<button class="btn btn-warning" name="signup_submit"><b>SIGNUP</b></button>
</div>
</form>
</div>
<div class="container-fluid mt-5 text-center " style="font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;position: absolute;top: 100%;">
<h3 class="mt-5">If You are already a Member <a href="login.php">Login Here</a></h3>
</div>
<script src="js/dark-mode.js"></script>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
$(document).ready(function()
{
$("body").animate({opacity:'1'}, 2000);
});
</script>
<audio src="audio/ring.mp3" id="play_audio"></audio>
<script>
function audio_play()
{
document.getElementById("play_audio").play();
}
</script>
</body>
</html>
<?php
$con = mysqli_connect("localhost", "root", "", "minor2");
error_reporting(0);
$user_name = $_POST['name'];
$user_email = $_POST['email'];
$user_password = $_POST['password'];
$user_phone = $_POST['phone'];
$user_institute = $_POST['institute'];
$user_place = $_POST['place'];
$user_gender = $_POST['gender'];
if(isset($_POST['signup_submit']))
{
$query = "insert into users (user_name, user_email, user_password, user_phone, user_institute, user_place, user_gender) values ('$user_name', '$user_email', '$user_password', '$user_phone', '$user_institute', '$user_place', '$user_gender')";
$run_query = mysqli_query($con, $query);
if($run_query)
{
echo "<script>alert('you are succssfully registered');</script>";
header("location:login.php");
}
}
?>