Improvements.
This commit is contained in:
24
subsites/words/upload.php
Normal file
24
subsites/words/upload.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
//WTFPL 2.0
|
||||
header('Content-type: text/plain; charset=UTF-8');
|
||||
|
||||
$name = $_POST['name'];
|
||||
$text = stripslashes($_POST['text']);
|
||||
$pass = $_POST['pass'];
|
||||
|
||||
// Password check
|
||||
include('saved_crypt_pass.php');
|
||||
$crypt_pass = crypt($pass, $saved_crypt_pass);
|
||||
|
||||
if ($crypt_pass != $saved_crypt_pass)
|
||||
echo "Password error";
|
||||
else {
|
||||
try {
|
||||
$f = fopen("data/$name", 'w');
|
||||
fwrite($f, $text);
|
||||
fclose($f);
|
||||
} catch (Exception $e) {
|
||||
echo "File open/write error";
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user