- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsave.php
More file actions
Latest commit
20 lines (19 loc) · 669 Bytes
/
Copy pathsave.php
File metadata and controls
20 lines (19 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
if(isset($_POST['action'])) {
$userid = $_POST['userid'];
$fileName="./files/" . $userid . ".py";
if ($_POST['action'] == 'read') {
if (file_exists($fileName)) {
echofile_get_contents($fileName);
}
} elseif ($_POST['action'] == 'write') {
if( isset($_POST['data'])) {
$myfile = fopen($fileName, "w") ordie("Errore nell'apertura del file!");
$txt = $_POST['data'];
fwrite($myfile, $txt);
fclose($myfile);
echo"File salvato con successo!";
}
}
}
?>