Nieuw lid |
|
Ik heb het volgende scriptje gevonden
<?php
$filename = 'txt.txt';
$somecontent = "Add this to the file\n";
// Let's make sure the file exists and is writable first.
if (is_writable($filename)) {
// In our example we're opening $filename in append mode.
// The file pointer is at the bottom of the file hence
// that's where $somecontent will go when we fwrite() it.
if (!$handle = fopen($filename, 'a')) {
echo "Cannot open file ($filename)";
exit;
}
// Write $somecontent to our opened file.
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($somecontent) to file ($filename)";
fclose($handle);
} else {
echo "The file $filename is not writable";
}
?>
<?php $filename = 'txt.txt'; $somecontent = "Add this to the file\n"; // Let's make sure the file exists and is writable first. // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; } // Write $somecontent to our opened file. if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; } echo "Success, wrote ($somecontent) to file ($filename)"; } else { echo "The file $filename is not writable"; } ?>
Nu ben ik op zoek naar een manier om die $somecontent via een textveld in deze pagina te bepalen, zodat ik het dus online kan toevoegen ipv de txt.txt te openen/aanpassen/uploaden.
als iemand mij kan helpen zou ik dat zeer op prijs stellen.
alvast bedankt.
|