diff interface/save_word_list.php @ 0:b12c99b7c3f0

commit for previous development
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 19 Jan 2015 17:13:49 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/interface/save_word_list.php	Mon Jan 19 17:13:49 2015 +0100
@@ -0,0 +1,20 @@
+<?php
+
+if ($_POST['text']){
+	$date = date('Y_m_d_H_i_s', time());
+	if ( file_exists("wordlist/".$_POST['filename'].".txt") ) {
+		$oldFile = file_get_contents("wordlist/".$_POST['filename'].".txt");
+		file_put_contents("wordlist/".$_POST['filename']."_".$date.".txt", $oldFile);
+	}
+	
+	if (get_magic_quotes_gpc()) {
+		$require = stripslashes($_POST['text']);
+	} else {
+		$require = $_POST['text'];
+	}
+	$require = preg_replace("/<br>/u", "", $require);
+	file_put_contents("wordlist/".$_POST['filename'].".txt", $require);
+}
+
+
+?>
\ No newline at end of file