-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchecking.php
140 lines (117 loc) · 2.83 KB
/
checking.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
<?php
include ( "inc/connection.inc.php" );
ob_start();
session_start();
if (!isset($_SESSION['user_login'])) {
header('location: logout.php');
}
else {
$user = $_SESSION['user_login'];
$result = $con->query("SELECT * FROM user WHERE id='$user'");
$get_user_name = $result->fetch_assoc();
$uname_db = $get_user_name['fullname'];
$utype_db = $get_user_name['type'];
}
if (isset($_REQUEST['teacher'])) {
if($_REQUEST['teacher'] == "logastchr"){
$error = "You Logged as Teacher. Only Student can post!";
}else{
header('location: logout.php');
}
}else{
header('location: logout.php');
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<link href="css/footer.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body class="body1">
<div>
<div>
<header class="header">
<div class="header-cont">
<?php
include 'inc/banner.inc.php';
?>
</div>
</header>
<div class="w3-sidebar w3-bar-block w3-collapse w3-card-2 w3-animate-left" stylRe="width:100px;" id="mySidebar">
<button class="w3-bar-item w3-button w3-large w3-hide-large" onclick="w3_close()">Close ×</button>
<a href="index.php" class="w3-bar-item w3-button">Tution</a>
<a href="photography.php" class="w3-bar-item w3-button">Photography</a>
<a href="#" class="w3-bar-item w3-button">IT</a>
</div>
<div class="topnav">
<a onclick="w3_open()"><img src="image/menuicon2.png" width="16px" height="15px"></a>
<a class="active" href="index.php" style="margin: 0px 0px 0px 52px;">Newsfeed</a>
<a href="search.php">Search Tutor</a>
<?php
if($utype_db == "teacher")
{
}else {
echo '<a href="postform.php">Post</a>';
}
?>
<a href="#contact">Contact</a>
<a href="#about">About</a>
<div style="float: right;" >
<table>
<tr>
<?php
if($user != ""){
echo '<td>
<a href="profile.php?uid='.$user.'">'.$uname_db.'</a>
</td>
<td>
<a href="logout.php">Logout</a>
</td>';
}else{
echo '<td>
<a href="login.php">Login</a>
</td>
<td>
<a href="registration.php">Register</a>
</td>';
}
?>
</tr>
</table>
</div>
</div>
</div>
<!-- newsfeed -->
<div class="nbody" style="margin: 0px 100px; overflow: hidden;">
<div class="nfeedleft">
<?php
echo '
<div class="nfbody">
<div class="p_body">
<p>'.$error.'</p>
</div>
</div>';
?>
</div>
<div class="nfeedright">
</div>
</div>
<!-- footer -->
<div>
<?php
include 'inc/footer.inc.php';
?>
</div>
</div>
<script>
function w3_open() {
document.getElementById("mySidebar").style.display = "block";
}
function w3_close() {
document.getElementById("mySidebar").style.display = "none";
}
</script>
</body>
</html>