Postingan lainnya
cara membaca file php
bageimana caranya supaya file php bisa muncul dibrowser, tujuanya supaya bisa muncunl ditextarea lalu diedit file phpnya..
0
2 Jawaban:
Jawaban Terpilih
"bageimana caranya supaya file php bisa muncul dibrowser, tujuanya supaya bisa muncunl ditextarea lalu diedit file phpnya"
Jawab: Untuk membuat PHP Editor, Kamu bisa mencoba ini:
<?php
// configuration
$url = 'http://domain.com/backend/editor.php';
$file = '/path/to/txt/file';
// 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"><?php echo htmlspecialchars($text) ?></textarea>
<input type="submit" />
<input type="reset" />
</form>
Source: https://stackoverflow.com/questions/8226958/simple-php-editor-of-text-files
1