registrer3.php 5.74 KB
Newer Older
PALVADI HEMA's avatar
PALVADI HEMA committed
1
2
<?php
session_start();
Srinivas's avatar
Srinivas committed
3
4
5

include('connection.php');
$connection = getdb();
PALVADI HEMA's avatar
PALVADI HEMA committed
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
?>
<!DOCTYPE html>
<html lang="en-ca">
<head>
  <meta charset="utf-8">
  <title>About · Warden Page</title>
  <link href="css/inline-list.css" rel="stylesheet">
</head>
<body>

<header>
  <h1>Warden Page</h1>
  <nav>
    <ul class="nav">
      <li><a href="manage2.php">Home</a></li>
      <li><a href="stu1.php">Students History</a></li>
      <li><a class="current" href="first2.php">Registration</a></li>
      <li><a  href="first3.php">Total Students List</a></li>
    <li><a href="logout4.php">Logout</a></li>
</ul>
  </nav>
</header>
<link rel="stylesheet" href="css/style.css">
  <link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet">
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
  <title>Log in</title>
</head>

<style>
body {
        background-color: #F3EBF6;
        font-family: 'Ubuntu', sans-serif;
    }
    
    .main {
        background-color: #FFFFFF;
        width: 400px;
        height: 600px;
        margin: 0em auto;
        border-radius: 1.5em;
        box-shadow: 0px 11px 35px 2px rgba(0, 0, 0, 0.14);
    }
    .submit2 {
      cursor: pointer;
        border-radius: 5em;
        color: #fff;
        background: linear-gradient(to right, #9C27B0, #E040FB);
        border: 0;
        padding-left: 60px;
        padding-right: 60px;
        padding-bottom: 10px;
        padding-top: 10px;
        font-family: 'Ubuntu', sans-serif;
        margin-left: 70%;
        margin-right: 9%;
        font-size: 13px;
        box-shadow: 0 0 20px 1px rgba(0, 0, 0, 0.04);
    }
    .sign {
        padding-top: 20px;
        color: #8C55AA;
        font-family: 'Ubuntu', sans-serif;
        font-weight: bold;
        font-size: 23px;
    }
    
    .un {
    width: 76%;
    color: rgb(38, 50, 56);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    background: rgba(136, 126, 126, 0.04);
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    outline: none;
    box-sizing: border-box;
    border: 2px solid rgba(0, 0, 0, 0.02);
    margin-bottom: 50px;
    margin-left: 46px;
    text-align: center;
    margin-bottom: 27px;
    font-family: 'Ubuntu', sans-serif;
    }
    
    form.form1 {
        padding-top: 1px;
    }
    
    .pass {
            width: 76%;
    color: rgb(38, 50, 56);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    background: rgba(136, 126, 126, 0.04);
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    outline: none;
    box-sizing: border-box;
    border: 2px solid rgba(0, 0, 0, 0.02);
    margin-bottom: 50px;
    margin-left: 46px;
    text-align: center;
    margin-bottom: 27px;
    font-family: 'Ubuntu', sans-serif;
    }
    
   
    .un:focus, .pass:focus {
        border: 2px solid rgba(0, 0, 0, 0.18) !important;
        
    }
    
    .submit {
      cursor: pointer;
        border-radius: 5em;
        color: #fff;
        background: linear-gradient(to right, #9C27B0, #E040FB);
        border: 0;
        padding-left: 40px;
        padding-right: 40px;
        padding-bottom: 10px;
        padding-top: 10px;
        font-family: 'Ubuntu', sans-serif;
        margin-left: 35%;
        font-size: 13px;
        box-shadow: 0 0 20px 1px rgba(0, 0, 0, 0.04);
    }
    
    .forgot {
        text-shadow: 0px 0px 3px rgba(117, 117, 117, 0.12);
        color: #E1BEE7;
        padding-top: 15px;
    }
    
    a {
        text-shadow: 0px 0px 3px rgba(117, 117, 117, 0.12);
        color: #E1BEE7;
        text-decoration: none
    }
    
    @media (max-width: 600px) {
        .main {
            border-radius: 0px;
        }
     
        
   </style>

<body>
<?php
if($_SESSION['username4']){
?>
<p class="submit2" align="center">
<?php echo '<a href="first2.php">Go to previous page</a>' ?></p>
<div class="main">
<p class="sign" align="center">Warden Sign Up</p>
<form class="form1"  method="POST" action="" >
<input  class="un " type="text" name="user_id" align="center" placeholder="Username"><br>
<center>
<label for="HostelName"><h3>Choose Hostel type:</h3></label>
  <select id="HostelName" name="HostelName">
    <option value="Kanchanaganga Girls Hostel">Kanchanaganga Girls Hostel</option>
    <option value="Vaddeswaram Girls Hostel">Vaddeswaram Girls Hostel</option>
    <option value="Vindhya Boys Hostel">Vindhya Boys Hostel</option>
    <option value="Aravali Boys Hostel">Aravali Boys Hostel</option>
  </select>
</center>
<br>
<input class="pass" type="password" name="user_pass" align="center" placeholder="Password">
<input class="pass" type="password" name="user_pass1" align="center" placeholder="Confirm Password">
<input  class="submit" type="submit" align="center" type="submit" name="search" value="Sign Up">
<center>
    <img src="kl.jpg" alt="Snow" style="width:228px;height:228px;">
</center> 
 </form>
</div>

<table>
<?php
if(isset($_POST['search']))
{



if (isset($_POST['user_id']) and isset($_POST['HostelName']) and isset($_POST['user_pass'])and isset($_POST['user_pass1'])){
	
// Assigning POST values to variables.
$username = $_POST['user_id'];
$password = $_POST['user_pass'];
$cpassword= $_POST['user_pass1'];
$HostelName = $_POST['HostelName'];
if ($cpassword==$password){
Srinivas's avatar
Srinivas committed
203
204
if($connection->connect_error){
die('Connection Failed  : '.$connection->connect_error);
PALVADI HEMA's avatar
PALVADI HEMA committed
205
206
} 
else{
Srinivas's avatar
Srinivas committed
207
$stmt = $connection->prepare("insert into user_login(username,Password,HostelName)
PALVADI HEMA's avatar
PALVADI HEMA committed
208
209
210
211
       values(?,?,?)");
$stmt->bind_param("sss",$username,$password,$HostelName);
$stmt->execute();
$stmt->close();
Srinivas's avatar
Srinivas committed
212
$connection->close();
PALVADI HEMA's avatar
PALVADI HEMA committed
213
214
215
216
217
218
219
220
221
222
223
224
225
}echo "<script>location.href='success.php'</script>";
}
}
else{}  
}
?> </table></center>
<?php
}
else{
echo "<script>location.href='3.php'</script>";
}
?>
</body>
Srinivas's avatar
Srinivas committed
226
</html>