-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdatePath.php
More file actions
35 lines (32 loc) · 1002 Bytes
/
updatePath.php
File metadata and controls
35 lines (32 loc) · 1002 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
<?php
session_start();
$path = $_POST['finalPath'];
$user = $_SESSION['user'];
$filename = $_POST['filename'];
//$filename = "dwalin".$filename;
$initPath = $_POST['initialPath'];
//$initPath = substr_replace(" / ","!",$initPath);
//if($initPath == "Home"){
// $initPath ="!";
// }
//else{
// $initPath = substr(4,$initPath);
//}
$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();
}
else
{
$query = "UPDATE filesystem SET directory_path = '$path' WHERE owner='$user' AND file_name='$filename' AND directory_path ='$initPath' ";
//echo $query;
if($result = mysqli_query($con, $query))
{
echo 'File Moved Successfully.';
include 'backup_failure.php';
write_log($query);
}
}
?>