-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
36 lines (30 loc) · 820 Bytes
/
index.php
File metadata and controls
36 lines (30 loc) · 820 Bytes
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
<?php
$host = "localhost";
$user = "root";
$password = "";
$db = "loginCredentials"; //here in place of loginCredentials change it with the name of the database u are using
$link = mysqli_connect($host,$user,$password,$db);
mysqli_select_db($link,$db);
$uid = $_POST['UID'];
$pass = $_POST['pass'];
if($uid == "" or $pass == ""){
header('location:index.html');
}
else {
if ($uid == "admin" and $pass = "admin"){
header('location:data.html');
}
else{
$sql = "select * from logindata where userID='$uid'
&& password='$pass'";
$result = mysqli_query($link, $sql);
$num = mysqli_num_rows($result);
if($num == 1){
header('location:geo.html');
// here it should be to the geolocation file
}else{
header('location:index.html');
}
}
}
?>