-
Notifications
You must be signed in to change notification settings - Fork 0
/
vschool.php
39 lines (37 loc) · 943 Bytes
/
vschool.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
<?php session_start();?>
<?php
if(isset($_POST["submit"]))
{
$i=$_POST["institute_name"];
$u=$_POST["username"];
$p=md5($_POST["password"]);
$con=mysqli_connect("localhost","root","");
$w=mysqli_select_db($con,$i);
if(!$w)
{
echo "<script>alert('Your institute is not register');
window.location='schoollogin.html';</script>";
}
else
{
mysqli_select_db($con,"");
mysqli_select_db($con,"educomm");
$result=mysqli_query($con,"SELECT id FROM admins where uname='$u' and passwords='$p'");
$row=mysqli_num_rows($result);
if($row==0)
{
echo "<script>alert('Username or Password is incorrect');
window.location='schoollogin.html';</script>";
}
if($row==1)
{ $_SESSION['user']=$u;
if(isset($_SESSION['user']))
{
$_SESSION['institute_name']=$i;
echo "<script>
window.location='school/adminpanel.php?user=$u & inst=$i';</script>";
}
}
}
}
?>