From f8b2741d005bdee9d8125841fb7c259e65519798 Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Tue, 28 Oct 2008 02:33:37 +0000 Subject: [PATCH] Made delete happen immediately without leaving the current page. --- playonwii/delete.php | 31 +++++++++-------------- playonwii/delete_error.php | 16 ++++++++++++ playonwii/index.php | 62 +++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 89 insertions(+), 20 deletions(-) create mode 100644 playonwii/delete_error.php diff --git a/playonwii/delete.php b/playonwii/delete.php index 7b260e7..161b29b 100644 --- a/playonwii/delete.php +++ b/playonwii/delete.php @@ -1,26 +1,19 @@ - - - - - <?php print "Deleted $deleted_file_path"; ?> - +$success = touch( $deleted_file_path ); - - -

File '' deleted.

- -

Back

- - - - +if( !$success ) +{ + header("HTTP/1.1 500 Internal Server Error"); + print "Unable to delete file."; +} +else +{ + print "File deleted."; +} +?> diff --git a/playonwii/delete_error.php b/playonwii/delete_error.php new file mode 100644 index 0000000..bca57c5 --- /dev/null +++ b/playonwii/delete_error.php @@ -0,0 +1,16 @@ + + + + <?php print "Failed to delete"; ?> + + + + +

File was not deleted! An error occurred.

+ +

Back

+ + + + + diff --git a/playonwii/index.php b/playonwii/index.php index ef0c805..4d921b5 100644 --- a/playonwii/index.php +++ b/playonwii/index.php @@ -211,6 +211,58 @@ foreach( $sorted_fns as $filename ) @@ -280,7 +340,7 @@ function title_click( table_id ) } print ""; - print "[DELETE]\n"; + print "[DELETE]\n"; } print "\n"; $table_counter += 1; -- 2.11.4.GIT