-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshared_with_me.php
More file actions
57 lines (48 loc) · 1.53 KB
/
shared_with_me.php
File metadata and controls
57 lines (48 loc) · 1.53 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
<?php
//Start session to access session variables.
session_start();
echo '<link rel="stylesheet" href="css/dropdown.css" type="text/css">';
$count = 0;
//Set variables to perform database query.
$user = $_SESSION['user'];
//Establish connection.
$query = "SELECT * FROM filesystem WHERE owner='$user' AND shared_by != '' AND isFolder = '0' ";
$con=mysqli_connect("localhost","root","r00tpass","mysql_db");
if (mysqli_connect_errno())
{
//Unable to establish connection.
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
//Perform query.
$result = mysqli_query($con, $query);
//If query is performed unsuccessfully.
if(!$result)
{
echo "Unable to access database.<br>";
}
//Create options table.
echo '<div style="margin-top:-10px">';
echo '<div class="tablehead">';
echo '<div id = "options"></div>';
//File parameter table.
echo '
<table width="84%" cellpadding="8px" class="heading">
<tr id="row_id" class="border_bottom">
<td width="55%">File Name</td>
<td width="20%">Type</td>
<td >Shared By</td>
<tr>
</table><br>
';
echo '</div>';
echo '<div class="tables">';
echo '<table width="80%" cellpadding="10px" class="table">';
//Traverse through query results.
while($row = mysqli_fetch_array($result))
{
include 'FileList.php';
}
echo '</table>';
echo '</div>';
echo '</div>';
?>