forked from Encrypt-S/navpi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.php
executable file
·40 lines (30 loc) · 899 Bytes
/
notes.php
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
<?php
include ("header.php");
include ("pass.php");
$notesLocation = "/home/stakebox/UI/".$currentWallet."notes.php";
function changenotes(){
global $notesLocation;
global $newnotes;
if(!file_exists("$notesLocation")){
$file = fopen("$notesLocation","w");
fwrite($file,"");
fclose($file);
}
if (is_readable($notesLocation) == FALSE)
die ("The notes file must be writable.") ;
// Open the file and erase the contents if any
$fp = fopen($notesLocation, "w");
// Write the data to the file
// CODE INJECTION WARNING!
fwrite($fp, "<?php\n\$notes='$newnotes';\n?>");
// Close the file
fclose($fp);
echo '<h4><a><p><b>Your notes have been changed.</p></b></a></h4>' ;
}
$newnotes = $_POST['notes'];
changenotes();
print_r('The following has been written to the notes file: ');
print_r($_POST['notes']);
?>
</div>
<?php include ("footer.php");?>