diff --git a/views/new_twt.php b/views/new_twt.php index ca80a5b..cf9a069 100644 --- a/views/new_twt.php +++ b/views/new_twt.php @@ -17,6 +17,8 @@ $public_txt_url = $config['public_txt_url']; $timezone = $config['timezone']; require_once 'libs/load_timezone.php'; +//session_start(); // Post-Redirect-Get Pattern based on: https://icodemag.com/prg-pattern-in-php-what-why-and-how/ + if (isset($_POST['submit'])) { $new_post = filter_input(INPUT_POST, 'new_post'); $new_post = trim($new_post); @@ -31,10 +33,12 @@ if (isset($_POST['submit'])) { // Check if we have a point to insert the next Twt define('NEW_TWT_MARKER', "#~~~#\n"); - if (!file_exists($txt_file_path)) { - echo 'twtxt.txt file does not exist. Check your config.'; - exit; - } + // if (!file_exists($txt_file_path)) { + // echo ''; + // exit; + // } + + if(!file_exists($txt_file_path)) exit("
twtxt.txt file does not exist. Check your config.ini
";
@@ -70,7 +68,7 @@ if(isset($_POST['submit'])) {
// If file with name already exists then append time in
// front of name of the file to avoid overwriting of file
if(file_exists($file_path)) {
- $msg .= "Error uploading {$file_name} - File already exists!
";
+ $msg .= "Error uploading {$file_name} - File already exists!
";
// $file_path = $upload_dir.date('Y-m-d_').$file_name;
// if( move_uploaded_file($file_tmpname, $file_path)) {
@@ -112,7 +110,7 @@ if(isset($_POST['submit'])) {
// If file extension not valid
//$msg .= '
';
- $msg .= "Error uploading {$file_name} for unknown reason";
+ $msg .= "Error uploading {$file_name} for unknown reason";
$msg .= "({$file_ext} file type is not allowed)
";
//$msg .= '