-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsave.php
More file actions
36 lines (23 loc) · 730 Bytes
/
save.php
File metadata and controls
36 lines (23 loc) · 730 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
$endl = "\n\r";
//SAVING ALL
$s = fopen('save.log', 'w');
fwrite($s, "Session OPENED:$endl");
$post = file_get_contents('php://input');
fwrite($s, "Got Data: $post$endl");
$json = json_decode($post, true);
if(!isset($json['data'])){
$json['data'] = "<html>\n<head></head><body>File wounded!</body>\n</html>";
}
if(!isset($json['path'])){
fwrite($s, "Path not specified! $endl");
$json['path'] = "dump.txt";
}
fwrite($s, "File path set to: ".$json['path']."$endl");
$file = fopen($json['path'], "w");
fwrite($file, $json['data']);
fclose($file);
fwrite($s, "Data saved: ".$json['data']."$endl");
fwrite($s, "Data successfully saved!$endl");
fclose($s);
?>