-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhostel.php
More file actions
135 lines (100 loc) · 3.5 KB
/
hostel.php
File metadata and controls
135 lines (100 loc) · 3.5 KB
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
<?php
$message="";
$message1="";
session_start();
require_once("connect.php");
error_reporting(E_ERROR | E_PARSE);
if(empty($_SESSION['email']))
{
header("location:login.php"); }
$aa=$_SESSION["aadh"];
$sql="SELECT * FROM `hostel_details` WHERE aadhaar= '$aa' ";
$result=mysqli_query($connect,$sql);
$b=$result->fetch_assoc();
if ($b['aadhaar']==null){
if(isset($_POST['next5'])){
$aadh=$_SESSION['aadh'];
$hostelname=$_POST['hname'];
$hosteltaluka=$_POST['htaluka'];
$hosteldistrict=$_POST['hdistrict'];
$hno=$_POST['hno'];
$sql = " INSERT INTO hostel_details(aadhaar,hostelname,hosteltaluka,hosteldistrict,hostelRegistrationNumber) VALUES ('$aadh','$hostelname','$hosteltaluka','$hosteldistrict','$hno')";
$result = mysqli_query($connect, $sql);
if($result)
{
header("location:college.php");
}
else{
header("location:college.php");
}
}
}
else if ($b['aadhaar']===$_SESSION['aadh']) {
header("location:college.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Scholarship</title>
<link rel="stylesheet" href="css/style.css">
<style>
.from{
border-radius: 5%;
background-color:white ;
font-family: 'Courier New', Courier, monospace;
position: absolute;
padding: 3% 5% 3% 5%;
margin-top: 3%;
width: 30%;
height:auto;
top: 15%;
left: 30%;
right: 30%;
}
</style>
</head>
<body>
<section>
<nav>
<h1>Scholarship</h1>
<div class="navlink">
<ul>
<li><a href="about.html">About</a></li>
<li><a href="home.php?data=1">Home</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</div>
</nav>
</section>
<section >
<div class="from">
<form action="hostel.php" method="post" enctype='multipart/form-data'>
<div class="span">Hostel Details</div>
<div class="form">
<div class="text">
<input type="text" name="hname" id="hname" placeholder='Hostel Name' Required>
</div>
<div class="text">
<input type="text" name="htaluka" id="htaluka" placeholder='Hostel Taluka' Required>
</div>
<div class="text">
<input type="text" name="hdistrict" id="hdistrict" placeholder='Hostel District' Required>
</div>
<div class="text">
<input type="text" name="hno" id="hno"placeholder='Hostel Registration Number' Required>
</div>
<div class="checkbox1">
<input type="checkbox" name="checkbox" Required> Verify details before going to Next Page
</div>
<div class="button">
<input type="submit" value="→" name="next5" >
</div>
</form>
</div>
</section>
</body>
</html>