-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_connect.php
More file actions
43 lines (34 loc) · 1 KB
/
Copy pathuser_connect.php
File metadata and controls
43 lines (34 loc) · 1 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
<?php
if(isset($_POST['login']))
{
session_start();
$id = $_POST['id'];
$filename = $_POST['filename'];
$connection = mysqli_connect('localhost','root','','db');
if(!$connection){die("Connection Error -> ".mysqli_connect_error());}
$sql = "SELECT * FROM `file_uploads` WHERE filename = '$username' AND pass = '$password'";
$result = mysqli_query($connection, $sql);
if ($connection->query($sql) == TRUE) {
while($row = $result->fetch_assoc())
//while($row = mysql_fetch_array($result))
{
$fiel1=$row["priv"];
echo $fiel1;
//$res=echo ".$row['privilege']."
if($fiel1==0)
{
echo $fiel1;
header("refresh:1, url=adminwelcome.html");
echo "New record created successfully";
}
elseif($fiel1==1){
header("refresh:1, url=welcome.html");
echo "New record created successfully";
}
}
// header("refresh:1, url=welcome.html");
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
}
?>