-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupload.php
More file actions
executable file
·39 lines (34 loc) · 1.12 KB
/
upload.php
File metadata and controls
executable file
·39 lines (34 loc) · 1.12 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
<?php
require("./etc/file_dispatcher/config.php");
require("./etc/sql.php");
require("./modules/file_dispatcher/sql/db_dispatcher.php");
require('./modules/file_dispatcher/main.php');?>
<?php
session_start();
if(isset($_POST['article']))
echo 'POST'.$_POST["article"].$_SESSION["path"];
$z = new dispatcher("./data",$_SESSION["path"],'r',1);
echo '<br>lecture mode get this code:'.$z->get_h_code().'<br>';
if( $z->get_h_code() != "NOT_FOUND" ){ //UPDATE
$z = new dispatcher("./data",$_SESSION["path"],'u',1);
echo $_SESSION["path"]." - 'u',1";
echo $z->getError();
}
else { //CREATE
$cnnx = new db_dispatcher();
$z = new dispatcher("./data", ltrim($_SESSION["path"], '/'),'c',$cnnx->get_userid($_SESSION['user']));
echo $_SESSION["path"]." - 'c',1";
echo $z->getError();
}
$z->new_version();
$z->save_in_file($_POST['article']);
if(isset($_FILES)) {
echo "<br><br>FILES : ";
print_r($_FILES);
echo "<br>finfiles<br>";
$z->create_attach($_FILES['fileToUpload']);
}
echo '<br>H8CODE'.$z->get_h_code()." saved in:";
print_r($z->get_tree());
header("location: "."/lecture/".ltrim($_SESSION["path"], '/'));
?>