scratch
/quickload/share-text.php/store-text.php |
@@ -8,11 +8,6 @@ |
require_once('inc/functions.php'); |
require_once('config.php'); |
|
#### Retrieve uploaded file. |
if (!isset($_POST['data']) or empty($_POST['data']) or |
!isset($_POST['action']) or empty($_POST['action'])) |
return; |
|
#### Build the user path. |
$userPath = join( |
DIRECTORY_SEPARATOR, |
@@ -28,16 +23,20 @@ |
realpath($pathPart['dirname']), realpath($STORE_FOLDER)) != 0) |
return; |
|
$data = $_POST['data']; |
|
switch(strtoupper($_POST['action'])) { |
case 'SAVE': |
switch($_SERVER['REQUEST_METHOD']) { |
case 'POST': |
#### Retrieve uploaded file. |
if(!isset($_POST['data']) or empty($_POST['data'])) |
return; |
|
#### Store the file. |
atomized_put_contents($userPath, $data); |
atomized_put_contents($userPath, $_POST['data']); |
break; |
case 'LOAD': |
case 'GET': |
if(!file_exists($userPath)) |
return; |
header('Content-Type: text/html; charset=utf-8'); |
echo atomized_get_contents($userPath, $data); |
echo atomized_get_contents($userPath); |
break; |
} |
|