Mercurial > hg > extraction-interface
annotate 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 |
rev | line source |
---|---|
0
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
1 <?php |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
2 |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
3 if ($_POST['text']){ |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
4 $date = date('Y_m_d_H_i_s', time()); |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
5 if ( file_exists("wordlist/".$_POST['filename'].".txt") ) { |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
6 $oldFile = file_get_contents("wordlist/".$_POST['filename'].".txt"); |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
7 file_put_contents("wordlist/".$_POST['filename']."_".$date.".txt", $oldFile); |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
8 } |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
9 |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
10 if (get_magic_quotes_gpc()) { |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
11 $require = stripslashes($_POST['text']); |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
12 } else { |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
13 $require = $_POST['text']; |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
14 } |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
15 $require = preg_replace("/<br>/u", "", $require); |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
16 file_put_contents("wordlist/".$_POST['filename'].".txt", $require); |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
17 } |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
18 |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
19 |
b12c99b7c3f0
commit for previous development
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
20 ?> |