First commit.
This commit is contained in:
26
subsites/pictures/edit/edit.php
Executable file
26
subsites/pictures/edit/edit.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
header('Content-type: text/plain; charset=UTF-8');
|
||||
|
||||
$img = $_POST['image'];
|
||||
$info = $_POST['uptext'];
|
||||
$pass = $_POST['uppass'];
|
||||
$info_path = "../info/$img.info";
|
||||
|
||||
// Password check
|
||||
include('../saved_crypt_pass.php');
|
||||
$crypt_pass = crypt($pass, $saved_crypt_pass);
|
||||
|
||||
if ($crypt_pass != $saved_crypt_pass) {
|
||||
echo "Password error";
|
||||
die();
|
||||
}
|
||||
|
||||
$info = str_replace('\\\'', '\'', str_replace('\"', "\"", $info));
|
||||
|
||||
// Info file
|
||||
$f = fopen($info_path, 'w');
|
||||
fwrite($f, $info);
|
||||
fclose($f);
|
||||
|
||||
header("Location: http://pictures.metanohi.org/$img");
|
||||
?>
|
||||
30
subsites/pictures/edit/index.php
Executable file
30
subsites/pictures/edit/index.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
header('Content-type: text/html; charset=UTF-8');
|
||||
$img = $_GET['i'];
|
||||
|
||||
$info_path = "../info/$img.info";
|
||||
|
||||
// Info file
|
||||
$f = fopen($info_path, 'r');
|
||||
$c = fread($f, filesize($info_path));
|
||||
fclose($f);
|
||||
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns='http://www.w3.org/1999/xhtml'>
|
||||
<head>
|
||||
<meta name='description' content='Edit the info text of a picture. Owner only.' />
|
||||
<meta http-equiv='content-language' content='en' />
|
||||
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
|
||||
<title>Edit info text</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form action='edit.php' method='post'>
|
||||
<input type='hidden' name='image' value='<?php echo $img; ?>' />
|
||||
<p><textarea name='uptext' rows='10' cols='80'><?php echo $c; ?></textarea></p>
|
||||
<p><input name='uppass' type='password' /></p>
|
||||
<p><input type='submit' value='Change text' /></p>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
3
subsites/pictures/edit/php_errorlog
Executable file
3
subsites/pictures/edit/php_errorlog
Executable file
@@ -0,0 +1,3 @@
|
||||
[19-Oct-2009 05:02:21] PHP Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /home/metanohi/public_html/pictures/edit/edit.php on line 19
|
||||
[19-Oct-2009 05:04:08] PHP Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /home/metanohi/public_html/pictures/edit/edit.php on line 20
|
||||
[19-Oct-2009 05:33:58] PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/metanohi/public_html/pictures/edit/edit.php on line 18
|
||||
Reference in New Issue
Block a user