summaryrefslogtreecommitdiff
path: root/upload-org.php
blob: 40f403f97da57e5585d8ac12817bc6e878a3d8ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
$dir = '/home/luke/j1-uploads/';

$set = isset($_POST['org_data']) && isset($_POST['filename']);
if ($set) {
	$filename = $dir.'/'.rawurlencode($_POST['filename']).'.org';
	$fd = fopen($filename, 'w');
	fwrite($fd, $_POST['word_data']);
	fclose($fd);
	echo 'uploaded';
} else {
	?>
	<form method="post" action="upload-msword.php">
		<input type="text" name="filename" />
		<textarea name="org_data"></textarea>
	</form>
	<?php
}