-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
209 lines (194 loc) · 8.16 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!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">
<title>Signup</title>
<script src="https://code.jquery.com/jquery-3.4.1.js"></script>
<!-- Font Icon -->
<link rel="stylesheet" href="src/login/fonts/material-icon/css/material-design-iconic-font.min.css">
<!-- Main css -->
<link rel="stylesheet" href="src/login/css/style.css">
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script type="text/javascript">
$(window).on('scroll', function () {
if ($(window).scrollTop()) {
$('nav').addClass('black');
} else {
$('nav').removeClass('black');
}
})
</script> -->
</head>
<body>
<?php
$un=$ps=$na=$ph=$em=$ad=$ct=$ds=$st="";
$status= true;
if (!empty($_POST)) {
if (empty($_POST['uname'])) {
$status=false;
}
else {
$un=$_POST['uname'];
}
if (empty($_POST['pass'])) {
$status=false;
}
else {
$ps=sha1($_POST['pass']);
}
if (empty($_POST['name'])) {
$status=false;
}
else {
$na=$_POST['name'];
}
if (empty($_POST['phone'])) {
$status=false;
}
else {
$ph=$_POST['phone'];
}
if (empty($_POST['email'])) {
$status=false;
}
else {
$em=$_POST['email'];
}
if (empty($_POST['addr'])) {
$status=false;
}
else {
$ad=$_POST['addr'];
}
if (empty($_POST['city'])) {
$status=false;
}
else {
$ct=$_POST['city'];
}
if (empty($_POST['dist'])) {
$status=false;
}
else {
$ds=$_POST['dist'];
}
if (empty($_POST['state'])) {
$status=false;
}
else {
$st=$_POST['state'];
}
$servername= "localhost";
$username= "root";
$password= "";
$dbname="electrothon";
//create connection
$com= new mysqli($servername, $username, $password,$dbname);
//check coonection
if ($com->connect_error ) {
die("Connection failed ".$com->connect_error);
}
else{
if($status){
$sql="INSERT INTO login(username, password, name, address, city, dist, state, phone, email) values ('$un','$ps','$na','$ad','$ct','$ds','$st','$ph','$em')";
if ($com->query($sql)) {
header ('Location: login.php');
}
else{
echo "Error: ".$sql."<br>".$com->error;
}
$com->close();
}}
}
?>
<!-- <nav class="navbar navbar-expand-md navbar-dark bg-dark">
<div class="navbar-collapse collapse w-100 order-1 order-md-0 dual-collapse2">
<span class="navbar-brand mb-0 h1">Hospital</span>
</div>
<div class="navbar-collapse collapse w-100 order-3 dual-collapse2">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="login.php">Login</a>
</li>
</ul>
</div>
</nav> -->
<!-- <div class="wrap">
<h2>Sign Up here</h2>
<form method="post">
<input type="text" name="uname" placeholder="Username" required autofocus>
<input type="text" name="name" placeholder="Hospital name" required>
<input type="email" name="email" placeholder="[email protected]" required>
<input type="number" name="phone" placeholder="Number" required>
<input type="password" name="pass" placeholder="password" required>
<input type="text" name="addr" placeholder="Address" required>
<input type="text" name="city" placeholder="City" required>
<input type="text" name="dist" placeholder="District" required>
<input type="text" name="state" placeholder="State" required>
<input type="submit" name="submit" value="Signup">
</form>
</div> -->
<div class="main">
<section class="signup">
<div class="container">
<div class="signup-content">
<form method="POST" id="signup-form" class="signup-form">
<h2 class="form-title">Create account</h2>
<div class="form-group">
<input type="text" class="form-input" name="name" id="name" placeholder="Hospital Name" required autofocus/>
</div>
<div class="form-group">
<input type="email" class="form-input" name="email" id="email" placeholder="Hospital Email"/>
</div>
<div class="form-group">
<input type="text" class="form-input" name="phone" id="name" placeholder="Phone No." required />
</div>
<div class="form-group">
<input type="text" class="form-input" name="addr" id="addr" placeholder="Address" required />
</div>
<div class="form-group">
<input type="text" class="form-input" name="city" id="city" placeholder="City" required />
</div>
<div class="form-group">
<input type="text" class="form-input" name="dist" id="dist" placeholder="District" required />
</div>
<div class="form-group">
<input type="text" class="form-input" name="state" id="state" placeholder="State" required />
</div>
<div class="form-group">
<input type="text" class="form-input" name="uname" id="name" placeholder="Username" required />
</div>
<div class="form-group">
<input type="password" class="form-input" name="pass" id="password" placeholder="Password"/>
<!-- <span toggle="#password" class="zmdi zmdi-eye field-icon toggle-password"></span> -->
</div>
<div class="form-group">
<input type="checkbox" name="agree-term" id="agree-term" class="agree-term" />
<label for="agree-term" class="label-agree-term"><span><span></span></span>I agree all statements in <a href="#" class="term-service">Terms of service</a></label>
</div>
<div class="form-group">
<input type="submit" name="submit" id="submit" class="form-submit" value="Sign up"/>
</div>
</form><center>
<p class="logihere">
Have already an account ? <a href="login.php" class="loginhere-link">Login here</a>
</p></center>
</div>
</div>
</section>
</div>
<!-- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous">
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous">
</script> -->
<script src="src/login/js/main.js"></script>
</body>
</html>